summaryrefslogtreecommitdiff
path: root/sample/getoptlong/abbrev.rb
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2022-05-09 07:10:45 +0900
committergit <svn-admin@ruby-lang.org>2022-05-09 07:13:55 +0900
commitf7539d5758ee5c83e6ec7792b100e830180896fd (patch)
tree748d9b2657b62b70e3f9865a493734275d272c33 /sample/getoptlong/abbrev.rb
parent98e3fdb44458615a1376cc60ea0909d07a6c2e4a (diff)
downloadruby-f7539d5758ee5c83e6ec7792b100e830180896fd.tar.gz
[ruby/getoptlong] ruby/ruby used sample, not examples
https://github.com/ruby/getoptlong/commit/39faa7b390
Diffstat (limited to 'sample/getoptlong/abbrev.rb')
-rw-r--r--sample/getoptlong/abbrev.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/sample/getoptlong/abbrev.rb b/sample/getoptlong/abbrev.rb
new file mode 100644
index 0000000000..9b89863626
--- /dev/null
+++ b/sample/getoptlong/abbrev.rb
@@ -0,0 +1,9 @@
+require 'getoptlong'
+
+options = GetoptLong.new(
+ ['--xxx', GetoptLong::NO_ARGUMENT],
+ ['--xyz', GetoptLong::NO_ARGUMENT]
+)
+options.each do |option, argument|
+ p [option, argument]
+end