perl_mystery has asked for the wisdom of the Perl Monks concerning the following question:
I have a script which I run using the following command line,what I noticed is people forget to add the options(-b,-l) and ran them without it.
finddata.exe -b file.txt -l data.txt
finddata.exe -b file.txt
finddata.exe -l data.txt
I tried use the below but it fails when the tool is run as below finddata.exe -b file.txt data.txt (note the missing -l before data. +txt). if ($#ARGV < 1) { print "USAGE"; }
Basically I want to make sure the optionsa re added.How do I that?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to make sure to print usage when the options are not entered?
by GrandFather (Saint) on Jan 27, 2011 at 01:13 UTC | |
| |
|
Re: How to make sure to print usage when the options are not entered?
by toolic (Bishop) on Jan 27, 2011 at 01:14 UTC | |
|
Re: How to make sure to print usage when the options are not entered?
by jethro (Monsignor) on Jan 27, 2011 at 01:23 UTC | |
|
Re: How to make sure to print usage when the options are not entered?
by Anonymous Monk on Jan 27, 2011 at 07:59 UTC |