Options handler for userspace programs



Hi Tim! I written new options parser for argv, string and
environment variable.

optsscan_argv() /* handle argv */
optsscan_strenv() /* handle string or env var */

They include getopt(), getopt_long() and
getopt_long_only() functionalities in two types of functions.
So, you can handle only short options, short and long
options and only long options, all in two types of functions.
Obviously, you can to handle an argument, with this syntax:

Short options:

-o
-o arg
-o= arg
-o=arg

Long options:

--option
--option argument
--option= argument
--option=argument

Link to tarball:

http://jo666.altervista.org/optsscan.tar.gz

Here, you can find optsscan code and a main example.

Thank you,
regards,

Andrea
_______________________________________________
freebsd-current@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: Options handler for userspace programs
    ... One that accepts a string ... Instead, getopt uses: ... can i include environment variable parser for options ... (The argv array ...
    (freebsd-current)
  • Re: Using the HMS functions in a user RPL program.
    ... similarly for an arg of 2.1 failing to add .002 to HMS) ... first, to invoke the internal ascii translator functions, ... on the 48 series you can edit and then remove the string quoting). ... POS {DUP 1 OVER ";" POS SUB ...
    (comp.sys.hp48)
  • Re: getopt and options with multiple arguments
    ... and then have the shell expand the * as usual, ... In the above case, there isn't even an option string before the *, but even if there was, I don't know how to get getopt to give me all the expanded filenames in an option. ... I have an irrational superstitious fear of getopt, so this is what i use (it returns a list of arguments, followed by a dict mapping flags to values; it only handles long options, but uses a single dash for them, as ...
    (comp.lang.python)
  • Re: symbols in GUI uicontrol
    ... Can I somehow make part of my string one font that will display the ... Create button with more flexible labeling than uicontrol. ... while arg <= length ...
    (comp.soft-sys.matlab)
  • Re: printf behaviour with illegal or malformed format string
    ... checking by GCC, but we cannot rely on the string being sane in libc, we still need to do error checking. ... All it can do is verify that two arbitrary format strings expect the same arguments and the documentation states it doesn't even manage that: The fmtcheckfunction does not understand all of the conversions that printfdoes. ... then any format that actually consumes the same arg types as the default will consume the ones passed. ... the compiler can't really do ...
    (freebsd-arch)