10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/adapters/cli.rb', line 10
def run(argv={})
args = parse(argv)
command,*rest = argv
command = "help" unless command
log = choose_log(args)
args.merge!({ opts: rest, log: log, internet: Idonethis::Adapters::Internet, view: Idonethis::Adapters::Views::Cli::List.method(:apply)})
credential = Settings.credential
log.call "args: #{args}, command: #{command}, rest: #{rest}"
use_case = choose command.to_sym, rest
unless use_case
puts "No command <#{command.to_sym}> found"
return
end
use_case.call credential, args
end
|