Class: PromptCanary::CLI

Inherits:
Object
  • Object
show all
Includes:
Commands::History, Commands::Status
Defined in:
lib/prompt_canary/cli.rb,
lib/prompt_canary/cli/commands/status.rb,
lib/prompt_canary/cli/commands/history.rb

Defined Under Namespace

Modules: Commands

Instance Method Summary collapse

Instance Method Details

#run(args) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/prompt_canary/cli.rb', line 12

def run(args)
  subcommand = args.shift
  case subcommand
  when "demote"   then demote(args)
  when "promote"  then promote(args)
  when "history"  then history(args)
  when "status"   then status(args)
  else
    warn "Unknown command: #{subcommand}"
    exit 1
  end
end