Class: Kaiser::Cmds::Show
Instance Method Summary
collapse
Methods inherited from Kaiser::Cli
all_subcommands_usage, #define_options, register, run_command, #set_config, #start_services, #stop_app, #stop_services
#option, #options
Instance Method Details
#execute(_opts) ⇒ Object
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/kaiser/cmds/show.rb', line 16
def execute(_opts)
ensure_setup
cmd = ARGV.shift
valid_cmds = 'ports cert-source http-suffix'
return Optimist.die "Available things to show: #{valid_cmds}" unless cmd
if cmd == 'ports'
Config.info_out.puts "app: #{app_port}"
Config.info_out.puts "db: #{db_port}"
elsif cmd == 'cert-source'
unless Config.config[:cert_source]
Optimist.die 'No certificate source set.
see kaiser set help'
end
source = Config.config[:cert_source][:url] || Config.config[:cert_source][:folder]
Config.info_out.puts source
elsif cmd == 'http-suffix'
Config.info_out.puts http_suffix
end
end
|
#usage ⇒ Object
6
7
8
9
10
11
12
13
14
|
# File 'lib/kaiser/cmds/show.rb', line 6
def usage
<<~EOS
Subcommand that shows information about the environment such as the TCP ports or the certificate used for HTTPS.
USAGE: kaiser show ports
kaiser show cert-source
kaiser show http-suffix
EOS
end
|