Options handler for userspace programs
Andrea Di Pasquale
spikey.it at gmail.com
Sun Jan 11 08:04:36 PST 2009
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
More information about the freebsd-current
mailing list