Loading ...
Sorry, an error occurred while loading the content.

Getopt::Long etiquitte

Expand Messages
  • Paul Archer
    When using Getopt::Long (or Getopt::Simple for that matter) is it considered good form or overkill to make sure that a user hasn t given two incompatible
    Message 1 of 3 , Dec 23, 2004
    • 0 Attachment
      When using Getopt::Long (or Getopt::Simple for that matter) is it
      considered good form or overkill to make sure that a user hasn't given two
      incompatible options (assuming that if he has, the program will run the
      first/most innocuous one)?

      Paul

      ----------------------------------------------------------------
      Q: What do Winnie-the-Pooh and John the Baptist have in common?
      A: Their middle name.
      ----------------------------------------------------------------
    • Jonathan Paton
      ... No such thing as overkill when dealing with users. Jonathan Paton -- #!perl $J= x25 ;for (qq
      Message 2 of 3 , Dec 24, 2004
      • 0 Attachment
        On Thu, 23 Dec 2004 16:59:22 -0600 (CST), Paul Archer <tigger@...> wrote:
        >
        > When using Getopt::Long (or Getopt::Simple for that matter) is it
        > considered good form or overkill to make sure that a user hasn't given two
        > incompatible options (assuming that if he has, the program will run the
        > first/most innocuous one)?

        No such thing as overkill when dealing with users.

        Jonathan Paton

        --
        #!perl
        $J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7+13 2-18 6+13
        17+6 02+1 2-10 00+4 00+8 3-13 3+12 01-5 2-10 01+1 03+4
        00+4 00+8 1-21 01+1 00+5 01-7 >=~/ \S\S \S\S /gx) {m/(
        \d+) (.+) /x,, vec$ J,$p +=$2 ,8,= $c+= +$1} warn $J,,
      • Paul Archer
        ... I ll buy that. I decided that I would put the list subroutine (listing a bunch of keywords) last, and every other subroutine function ( set , add , etc)
        Message 3 of 3 , Dec 24, 2004
        • 0 Attachment
          10:34am, Jonathan Paton wrote:

          >
          > On Thu, 23 Dec 2004 16:59:22 -0600 (CST), Paul Archer <tigger@...> wrote:
          > >
          > > When using Getopt::Long (or Getopt::Simple for that matter) is it
          > > considered good form or overkill to make sure that a user hasn't given two
          > > incompatible options (assuming that if he has, the program will run the
          > > first/most innocuous one)?
          >
          > No such thing as overkill when dealing with users.
          >

          I'll buy that. I decided that I would put the 'list' subroutine (listing a
          bunch of keywords) last, and every other subroutine function ('set', 'add',
          etc) sets a flag. So the list sub checks to make sure the flag hasn't been
          set (or that the '--list' opt was explicitly put on the command line) before
          it executes.

          Paul
        Your message has been successfully submitted and would be delivered to recipients shortly.