mirror of
https://github.com/tomgi/git_stats.git
synced 2024-12-22 13:32:17 +01:00
Added silent option.
This commit is contained in:
parent
e79f969b93
commit
ad8687f166
2 changed files with 7 additions and 1 deletions
|
@ -43,6 +43,7 @@ It browses the repository and outputs html page with statistics.
|
|||
f, [--from=FROM] # Commit from where statistics should start.
|
||||
t, [--to=TO] # Commit where statistics should stop.
|
||||
# Default: HEAD
|
||||
s, [--silent] # Silent mode. Don't output anything.
|
||||
|
||||
#### Start generator with default settings
|
||||
|
||||
|
|
|
@ -8,12 +8,17 @@ class GitStats::CLI < Thor
|
|||
option :language, :aliases => :l, :default => 'en', :desc => 'Language of written statistics.'
|
||||
option :from, :aliases => :f, :desc => 'Commit from where statistics should start.'
|
||||
option :to, :aliases => :t, :default => 'HEAD', :desc => 'Commit where statistics should stop.'
|
||||
option :silent, :aliases => :s, :type => :boolean, :desc => 'Silent mode. Don\'t output anything.'
|
||||
|
||||
desc 'generate', 'Generates the statistics of a repository'
|
||||
def generate
|
||||
I18n.locale = options[:language]
|
||||
GitStats::Generator.new(options[:path], options[:output], options[:from], options[:to]) { |g|
|
||||
g.add_command_observer { |command, result| puts "#{command}" }
|
||||
if options[:silent]
|
||||
g.add_command_observer { |command, result| }
|
||||
else
|
||||
g.add_command_observer { |command, result| puts "#{command}" }
|
||||
end
|
||||
}.render_all
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue