Class: Overcommit::CLI
- Inherits:
-
Object
- Object
- Overcommit::CLI
- Defined in:
- lib/overcommit/cli.rb
Overview
Responsible for parsing command-line options and executing appropriate application logic based on those options.
Instance Method Summary collapse
-
#initialize(arguments, input, logger) ⇒ CLI
constructor
rubocop:disable ClassLength.
- #run ⇒ Object
Constructor Details
#initialize(arguments, input, logger) ⇒ CLI
rubocop:disable ClassLength
7 8 9 10 11 12 13 14 |
# File 'lib/overcommit/cli.rb', line 7 def initialize(arguments, input, logger) @arguments = arguments @input = input @log = logger @options = {} Overcommit::Utils.log = logger end |
Instance Method Details
#run ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/overcommit/cli.rb', line 16 def run parse_arguments case @options[:action] when :install, :uninstall install_or_uninstall when :template_dir print_template_directory_path when :sign_plugins sign_plugins when :run_all run_all end rescue Overcommit::Exceptions::HookContextLoadError => ex puts ex exit 64 # EX_USAGE end |