Sha256: 9e7868e7b305e1a304e73885c24578606c79938f9d28444afe56083fc6066462

Contents?: true

Size: 733 Bytes

Versions: 1

Compression:

Stored size: 733 Bytes

Contents

#!/usr/bin/env ruby

require "Getopt/Declare"

def delold
  print "would have deleted\n"
end

args = Getopt::Declare.new(<<EOF)

		-a		Process all data

		-b <n:n>	Set mean byte length threshold to <N>
  					{ bytelen = n }

		+c <FILE>	Create new file <FILE>

		--del 		Delete old file
  					{ delold(); }

		delete 		[ditto]

		e <w:i>x<h:i>	Expand image to height <h> and width <w>
  					{ }

		-F <file>...	Process named file(s)
  					{ defer { file.each {|i| 
                                                  process(i) } } }

		=getrand [<n>]	Get a random number
				(or, optionally, <n> of them)
  					{ n = 1 unless !n.empty? }

		--		Traditionally indicates end of arguments
  					{ finish }

EOF

print args.inspect

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
getopt-declare-1.22 samples/cmdline_mid.rb