summaryrefslogtreecommitdiff
path: root/doc/optparse/ruby/long_with_negation.rb
diff options
context:
space:
mode:
Diffstat (limited to 'doc/optparse/ruby/long_with_negation.rb')
-rw-r--r--doc/optparse/ruby/long_with_negation.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/doc/optparse/ruby/long_with_negation.rb b/doc/optparse/ruby/long_with_negation.rb
new file mode 100644
index 0000000000..3f2913c361
--- /dev/null
+++ b/doc/optparse/ruby/long_with_negation.rb
@@ -0,0 +1,6 @@
+require 'optparse'
+parser = OptionParser.new
+parser.on('--[no-]binary', 'Long name with negation') do |value|
+ p [value, value.class]
+end
+parser.parse!