Permalink
Browse files

- Fixed bug which was not allowing the --help switch to be used

  • Loading branch information...
1 parent f4b465d commit 96083aa5895d13123851f71d10ef78dbe412a784 @tj committed Dec 1, 2008
Showing with 6 additions and 3 deletions.
  1. +6 −3 lib/commander/runner.rb
View
@@ -33,7 +33,7 @@ def run!
%w[ name version description ].each { |k| ensure_program_key_set k.to_sym }
case
when options[:version]; @output.puts "#{@program[:name]} #{@program[:version]}"
- when options[:help]; get_command(:help).run args_without_command
+ when options[:help]; get_command(:help).run
else active_command.run args_without_command
end
rescue InvalidCommandError
@@ -151,8 +151,11 @@ def create_default_commands
c.example "Display help for 'foo'", "command help foo"
c.when_called do |args, options|
gen = help_formatter
- @output.puts gen.render if args.empty?
- @output.puts gen.render_command(get_command(args.shift.to_sym)) unless args.empty?
+ if args.empty?
+ @output.puts gen.render
+ else
+ @output.puts gen.render_command get_command(args.shift.to_sym)
+ end
end
end
end

0 comments on commit 96083aa

Please sign in to comment.