Class: PleaseGPT::CLI
- Inherits:
-
Object
- Object
- PleaseGPT::CLI
- Defined in:
- lib/pleasegpt/cli.rb
Overview
CLI class for the command-line tool interface
Instance Method Summary collapse
Instance Method Details
#start(args) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/pleasegpt/cli.rb', line 9 def start(args) if args.empty? puts '>>> Please enter a valid command <<<' elsif args[0] == '-c' input = args[1..].join(' ') puts Api.generate_command(input).to_s.colorize(:green) else input = args.join(' ') puts Api.generate_text(input).to_s.colorize(:green) end end |