Sha256: 9f29da301bd648d1c19797dbe88d8c39b9dd661f2946beb1a861ae9ff2ba9e75

Contents?: true

Size: 725 Bytes

Versions: 9

Compression:

Stored size: 725 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 }

		--		Traditionally indicates end of arguments
  					{ finish }

EOF

print args.inspect

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
getopt-declare-1.32 samples/cmdline_mid.rb
getopt-declare-1.31 samples/cmdline_mid.rb
getopt-declare-1.30 samples/cmdline_mid.rb
getopt-declare-1.29 samples/cmdline_mid.rb
getopt-declare-1.26 samples/cmdline_mid.rb
getopt-declare-1.27 samples/cmdline_mid.rb
getopt-declare-1.23 samples/cmdline_mid.rb
getopt-declare-1.28 samples/cmdline_mid.rb
getopt-declare-1.25 samples/cmdline_mid.rb