Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#3 ability to turn off getopt_long

closed
Nicolas Dade
Portability (1)
3
2004-02-21
2004-02-15
Gimpy00Wang
No

Some OS's like FreeBSD don't have getopt_long support.
It would be nice to have the ability to disable the
getopt_long tests/features in order to make pwsafe more
portable...IMHO.

- G!mpy

Discussion

  • Gimpy00Wang
    Gimpy00Wang
    2004-02-15

    • priority: 5 --> 4
     
  • Gimpy00Wang
    Gimpy00Wang
    2004-02-15

    • priority: 4 --> 3
     
  • Gimpy00Wang
    Gimpy00Wang
    2004-02-15

    Logged In: YES
    user_id=976129

    BTW, I know libgnugetopt-1.2 and getopt-1.1.3 are in the
    ports collection, but what if they are not/can't be installed...

    - G!mpy

     
  • Nicolas Dade
    Nicolas Dade
    2004-02-17

    • assigned_to: nobody --> ndade
     
  • Nicolas Dade
    Nicolas Dade
    2004-02-17

    Logged In: YES
    user_id=957363

    Hmmm. There are options that are only available in long form
    (those I don't want to do by accident, like --createdb and
    --delete).

    I'm afraid that at the moment getopt_long is requred.

     
  • Nicolas Dade
    Nicolas Dade
    2004-02-17

    • labels: --> Portability
     
  • Carl Patten
    Carl Patten
    2004-02-19

    Logged In: YES
    user_id=540094

    I'm having similar difficulty. getopt_long isn't in Solaris gcc so I'm having to
    cobble it in from other files to make the source compile there.

    As an alternative, some other OSS projects such as Samba include a getopt.h
    in their source tree which gets linked in for OSs that need it.

     
  • Nicolas Dade
    Nicolas Dade
    2004-02-21

    Logged In: YES
    user_id=957363

    ok 0.1.5 can handle the lack of getopt_long. The one from
    samba was rather involved, so I just rolled my own in ~20
    lines. It's good enough for pwsafe.

    (It doesn't support optional arguments, which pwsafe doesnt
    have, and it doesn't reorder argv so all options must come
    before the commands. But that is the case with the non-gnu
    getopt() anway
    so it won't be a surprise.

     
  • Nicolas Dade
    Nicolas Dade
    2004-02-21

    • status: open --> closed