Class: N2B::CLI
Constant Summary
Constants inherited from Base
Base::CONFIG_FILE, Base::HISTORY_FILE
Class Method Summary collapse
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(args) ⇒ CLI
constructor
A new instance of CLI.
Methods inherited from Base
Constructor Details
#initialize(args) ⇒ CLI
Returns a new instance of CLI.
9 10 11 12 |
# File 'lib/n2b/cli.rb', line 9 def initialize(args) @args = args @options = end |
Class Method Details
.run(args) ⇒ Object
5 6 7 |
# File 'lib/n2b/cli.rb', line 5 def self.run(args) new(args).execute end |
Instance Method Details
#execute ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/n2b/cli.rb', line 14 def execute # Pass advanced_config flag to get_config config = get_config(reconfigure: @options[:config], advanced_flow: @options[:advanced_config]) user_input = @args.join(' ') # All remaining args form user input/prompt addition if @options[:diff] handle_diff_analysis(config) elsif user_input.empty? # No input text after options puts "Enter your natural language command:" input_text = $stdin.gets.chomp process_natural_language_command(input_text, config) else # Natural language command process_natural_language_command(user_input, config) end end |