in reply to Re^2: Issues w/ getOptions parsing options with pass_through enabled
in thread Issues w/ getOptions parsing options with pass_through enabled
How do you expect to know what any of the options means — or that they even exist — without reading the program's docs?
Scenario 1
You, as a reader of the command line, are making the *assumption* that -a is an option. The crafter of the command line should have avoided that confusion by using -cell=-a, but that doesn't excuse the negligence of the reader.
Scenario 2
You, as the crafter of the command line, don't know that -cell requires a parameter. The problem could be:
That's why it's important for the programmer to validate the input from the user. In all three cases, having something like the following would have helped:
usage("Bad value $opt_cell for option -cell") unless is_valid_cell($opt_cell);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Issues w/ getOptions parsing options with pass_through enabled
by Crackers2 (Parson) on May 24, 2006 at 03:54 UTC | |
by ikegami (Patriarch) on May 24, 2006 at 04:43 UTC | |
by Brawny1 (Initiate) on May 24, 2006 at 13:41 UTC |