lib/commandeer.rb in commandeer-0.1.0 vs lib/commandeer.rb in commandeer-0.1.1
- old
+ new
@@ -1,7 +1,7 @@
module Commandeer
- VERSION = "0.1.0"
+ VERSION = "0.1.1"
@commands = {}
def self.commands
@commands
@@ -40,18 +40,20 @@
# No args. Let's show what we have registered
if (args.size == 0) || (args[0] =~ /^-/)
output = ''
output << "Usage: #{@script_name} [command options] or [command subcommand options]\n\n"
- @commands.each do |command, options|
- next if (command==:klass || command==:parser)
- output << "\t#{command}\t"
+ @commands.keys.sort.each do |c|
+ options = @commands[c]
+ next if (c==:klass || c==:parser)
+ output << "\t#{c}"
unless options["subcommands"].nil?
- output << "Subcommands:"
+ output << "\tSubcommands:"
options["subcommands"].each do |sub, opts|
- output << " #{sub}"
+ output << "\t #{sub}"
end
end
+ output << "\n"
end
puts output
exit
end