lib/gli.rb in gli-1.1.0 vs lib/gli.rb in gli-1.1.1
- old
+ new
@@ -1,10 +1,11 @@
require 'gli/command_line_token.rb'
require 'gli/command.rb'
require 'gli/switch.rb'
require 'gli/flag.rb'
require 'gli/options.rb'
+require 'gli_version.rb'
require 'support/help.rb'
require 'support/rdoc.rb'
require 'support/initconfig.rb'
require 'etc'
@@ -12,12 +13,10 @@
# Git's does, in that you specify global options, a command name, command
# specific options, and then command arguments.
module GLI
extend self
- VERSION = '1.0.0'
-
@@program_name = $0.split(/\//)[-1]
@@post_block = nil
@@pre_block = nil
@@error_block = nil
@@config_file = nil
@@ -254,10 +253,10 @@
options[name] = value if !options[name]
end
flag_hash.each do |name,flag|
value = flag.get_value!(try_me)
- options[name] = value if !options[name]
+ options[name] = value if value
end
if try_me.empty?
return [global_options,command,command_options,arguments] if rest.empty?
# If we have no more options we've parsed them all