http://qs321.pair.com?node_id=21394


in reply to Command Line Arguments

Getopt::Long can have single-letter aliases for the long arguments. You separate the aliases with "|" in the argument specification. So for example if you say:
GetOptions('copies|n=i' => \$copies);
You will be able to use all of:
-n 5 --copies=5 --copies 5
as arguments.

--ZZamboni

Replies are listed 'Best First'.
RE: Re: Command Line Arguments
by Adam (Vicar) on Jul 07, 2000 at 08:11 UTC
    Thats cool. I didn't see that in the documentation. Sigh. I already wrote my own function to parse the command line aliasing the commands with single chars and allowing the grouping of single chars so you can say -bc instead of -b -c. That was this afternoon while PM was down. Now I don't know if I want to go back and replace that with Getopt::Long... We'll see. Plus my parser recognizes '/' as an alternative parameter lead in addition to '-'... sigh.

    Thanks ZZamboni