in reply to Inconsistent behavior of Getopt::Std

Getopt::Std is using the conventions traditionally used by Unix commands. For someone who's been using Unix/Linux for a long time, it's consistent with with the other(non-GNU) command's option parsing, with all of it's warts.

Getopt::Long follows the newer GNU conventions and may be closer to what you're expecting.

  • Comment on Re: Inconsistent behavior of Getopt::Std

Replies are listed 'Best First'.
Re^2: Inconsistent behavior of Getopt::Std
by likbez (Sexton) on Aug 16, 2020 at 11:55 UTC
    It depends on utility. For example vi processes options more intelligently:
    +num For the first file the cursor will be positioned on line "num". If "num" is missing, the cursor will be positioned on the last line.

      So, do you want your option processor to handle an option in the format +[num] (I'm guessing that's what you intended to write)?

      Give a man a fish:  <%-{-{-{-<