Class: HDOC::CLI
Overview
Provides the CLI interface for interact with the program.
Constant Summary collapse
- AVAILABLE_COMMANDS =
[ ['-i', '--init', 'Initialize necessary files.'], ['-c', '--commit', 'Register your progress and sync it.'], ['-p', '--push', 'Manually synchronize your online repository.'], ['-v', '--version', 'Show program version.'] ].freeze
Constants included from Actions
Actions::ENVIRONMENT, Actions::QUESTIONS
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(option_parser = OptionParser) ⇒ CLI
constructor
A new instance of CLI.
- #run ⇒ Object
Methods included from Actions
#commit, #init, #push, #version
Constructor Details
#initialize(option_parser = OptionParser) ⇒ CLI
Returns a new instance of CLI.
15 16 17 18 |
# File 'lib/1hdoc/cli.rb', line 15 def initialize(option_parser = OptionParser) @option_parser = option_parser check_for_configuration end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/1hdoc/cli.rb', line 5 def end |
Instance Method Details
#run ⇒ Object
20 21 22 23 24 |
# File 'lib/1hdoc/cli.rb', line 20 def run start_option_parser rescue @option_parser::ParseError $stderr.puts end |