-
Notifications
You must be signed in to change notification settings - Fork 553
Closed
Description
I think I have found a possible bug in boolean options. The value of the option is different when a CLI argument is included.
desc 'test1', 'This is test1 CLI'
option :skip_upload, default: false, type: :boolean
def test1
puts "test1: skip=#{options[:skip_upload]}"
end
desc 'test2', 'This is the test2 CLI'
option :skip_upload, default: false, type: :boolean
def test2(param)
puts "test2: skip=#{options[:skip_upload]}"
end
$ bundle exec exe/astcli cdr test1
test1: skip=false
$ bundle exec exe/astcli cdr test2 argument
test2: skip=false
$ bundle exec exe/astcli cdr test1 --skip-upload
test1: skip=true
$ bundle exec exe/astcli cdr test2 --skip-upload argument
test2: skip=false
Metadata
Metadata
Assignees
Labels
No labels