-
Notifications
You must be signed in to change notification settings - Fork 68
Open
Description
I often find mysql wanting to put --help on the end of a command to see the help text for that command. With commander, if I do that though, I first have to remove any --option options passed or I get 'command not found'
Example:
#!/usr/bin/env ruby
require 'rubygems'
require 'commander'
class MyApplication
include Commander::Methods
# include whatever modules you need
def run
program :name, 'test'
program :version, '0.0.1'
program :description, 'test'
command :bob do |c|
c.syntax = 'test bob [options]'
c.summary = ''
c.description = ''
c.example 'description', 'command example'
c.option '--some-switch', 'Some switch that does something'
c.action do |args, options|
# Do something or c.when_called Test::Commands::Bob
end
end
run!
end
end
MyApplication.new.run if $0 == __FILE__
Results in:
➜ ruby yourfile.rb --some-switch --help
invalid command. Use --help for more information
Is there any way to make this possible?
Metadata
Metadata
Assignees
Labels
No labels