Class: GitFame::Command
- Inherits:
-
Object
- Object
- GitFame::Command
- Includes:
- TTY::Option
- Defined in:
- lib/git_fame/command.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.call(argv = ARGV) ⇒ Object
107 108 109 110 111 112 113 |
# File 'lib/git_fame/command.rb', line 107 def self.call(argv = ARGV) cmd = new cmd.parse(argv, raise_on_parse_error: true) cmd.run rescue TTY::Option::InvalidParameter, TTY::Option::InvalidArgument => e abort e. end |
Instance Method Details
#run ⇒ Object
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
# File 'lib/git_fame/command.rb', line 115 def run if params[:help] puts help exit end if params[:version] puts "git-fame v#{GitFame::VERSION}" exit end thread = spinner.run do Render.new(result: result, **(:branch)) end thread.value.call rescue Dry::Struct::Error => e abort e. rescue Interrupt exit end |