summaryrefslogtreecommitdiff
path: root/doc/optparse/ruby/long_with_negation.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-04-11 09:03:07 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-04-11 09:03:36 +0900
commitf89486965b64bc04ed49073fd5ef48390e0026d2 (patch)
treeecfcd779d8c3ea9cf479edd21865dff98aeec0b9 /doc/optparse/ruby/long_with_negation.rb
parentcb01437c24ce3f819ef15947748e3c723b9c52c6 (diff)
[ruby/optparse] Moved rdoc files to doc/optparse
https://github.com/ruby/optparse/commit/cccb28e0de
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!