summaryrefslogtreecommitdiff
path: root/sample/getoptlong/types.rb
diff options
context:
space:
mode:
Diffstat (limited to 'sample/getoptlong/types.rb')
-rw-r--r--sample/getoptlong/types.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/sample/getoptlong/types.rb b/sample/getoptlong/types.rb
new file mode 100644
index 0000000000..ac74bfe12e
--- /dev/null
+++ b/sample/getoptlong/types.rb
@@ -0,0 +1,10 @@
+require 'getoptlong'
+
+options = GetoptLong.new(
+ ['--xxx', GetoptLong::REQUIRED_ARGUMENT],
+ ['--yyy', GetoptLong::OPTIONAL_ARGUMENT],
+ ['--zzz', GetoptLong::NO_ARGUMENT]
+)
+options.each do |option, argument|
+ p [option, argument]
+end