Class: Rbnotes::Commands::Commands

Inherits:
Command
  • Object
show all
Defined in:
lib/rbnotes/commands/commands.rb

Overview

Prints all command names into a single line. When -d (or --deve-commands) was specified, development commands (such conf) would be also printed in addition to general commands.

Defined Under Namespace

Classes: CmdNames

Instance Method Summary collapse

Instance Method Details

#descriptionObject

:nodoc:



9
10
11
# File 'lib/rbnotes/commands/commands.rb', line 9

def description             # :nodoc:
  "Print all command names into a single line"
end

#execute(args, conf) ⇒ Object



13
14
15
16
17
18
# File 'lib/rbnotes/commands/commands.rb', line 13

def execute(args, conf)
  @opts = {}
  parse_opts(args)

  puts commands(@opts[:print_deve_commands]).join(" ")
end

#helpObject



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/rbnotes/commands/commands.rb', line 20

def help
  puts <<HELP
usage:
#{Rbnotes::NAME} [-d|--deve-commands]

Print all command names into a single line.  If "-d" option (or
"--deve-commands") is specified, commands for development purpose are
also printed.

HELP
  print_commands
end