class KBSecret::CLI::Command::Commands
The implementation of `kbsecret commands`.
Public Class Methods
new(argv)
click to toggle source
Calls superclass method
KBSecret::CLI::Command::Abstract::new
# File lib/kbsecret/cli/command/commands.rb, line 8 def initialize(argv) super(argv) do |cli| cli.slop do |o| o.banner = <<~HELP Usage: kbsecret commands [options] HELP o.bool "-e", "--external-only", "list only external commands" o.bool "-i", "--internal-only", "list only internal commands" end end end
Public Instance Methods
run!()
click to toggle source
# File lib/kbsecret/cli/command/commands.rb, line 23 def run! cmds = if cli.opts.external_only? Command.external_command_names elsif cli.opts.internal_only? Command.internal_command_names else Command.all_command_names end.join "\n" puts cmds unless cmds.empty? end