perl:command_line_options_and_usage_with_getopts
This is an old revision of the document!
#!/usr/bin/perl use Getopt::Std; my %opt; getopts( 'afqcrh', \%opt ) or usage(); usage() if ($opt{h} or !@ARGV); sub usage() { (my $progName = $0) =~ s#.*[/\\]##; print <<EODOC; TITLE INFO Usage: $progName [-a | -f | -q] [-r] [-c] [-h] [files] Options: -a Stuff -f Stuff -q Stuff EODOC exit; }
perl/command_line_options_and_usage_with_getopts.1242310951.txt.gz · Last modified: 2009/05/14 07:22 by tkbletsc