Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Getopt::Long mystery

by DrWhy (Chaplain)
on Aug 18, 2005 at 02:18 UTC ( #484656=note: print w/replies, xml ) Need Help??


in reply to Getopt::Long mystery

Now, the interaction between bundling and ignore-case is documented, but NOWHERE IS IT SPECIFICALLY STATED that setting any particular configuration option (bundling, for example) disables the automatic abbreviation.
Abbreviation is not disabled with bundling. Abbreviation always applies only to 'long' (more than single character) options. Without bundling turned on, the module is looser about when it treats an option as a long option. Without bundling, -t may be a single letter option or an abbreviated long option.

With bundling turned on options beginning with a single '-' are treated as single character options exclusively. If you want to get the auto-abbreviation behavior of long names under bundling you must start the option with two '-'s. This is explicitly stated in the documentation.

--DrWhy

"If God had meant for us to think for ourselves he would have given us brains. Oh, wait..."

Replies are listed 'Best First'.
Re^2: Getopt::Long mystery
by Llew_Llaw_Gyffes (Scribe) on Aug 18, 2005 at 03:12 UTC
    With bundling turned on options beginning with a single '-' are treated as single character options exclusively. If you want to get the auto-abbreviation behavior of long names under bundling you must start the option with two '-'s. This is explicitly stated in the documentation.

    Aaaah.... That explains the behavior.  So, if one wishes to abbreviate the 'test' option to t with bundling enabled, one must somewhat counter-intuitively use '--t' instead of '-t'.  This was not clear to me from the documentation.

    I see, incidentally, that this remains true even with bundling_override set, which eliminates the double-dash requirement for long options, but evidently not for abbreviations thereof....

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://484656]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2020-05-29 01:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (166 votes). Check out past polls.

    Notices?