Suppose I want to enter 2 command line parameters - source and destination. GetOptions allows the command line by checking only the first character of the argument name instead of the full string. How do I validate for the full arguments strings instead of just allowing its substrings to be passed?
Here's an example program:
my ($source,$dest);
GetOptions(
'from=s' => \$source,
'to=s' => \$dest
) or die "Incorrect arguments\n";
It accepts any of:
-from
-fro
-fr
-f
-to
-t
However, I want it to accept only
-from
-to
and fail if anything except those full words is passed.
How can I disallow the abbreviated options?