1
0
Fork
You've already forked libarguments
0
Parsing command line arguments without if/case logic and built-in help renderer.
  • C 51.5%
  • Roff 48.5%
Find a file
2019年03月18日 23:15:56 +00:00
man3 libarguments version 8 files 2018年08月23日 22:33:46 +00:00
arguments.c Release comments 2019年03月18日 23:15:16 +00:00
arguments.h Release comments 2019年03月18日 23:15:16 +00:00
example1.c libarguments version 8 files 2018年08月23日 22:33:46 +00:00
example2.c libarguments version 3 files 2018年08月23日 22:21:49 +00:00
example3.c Extend example3 2019年03月17日 23:11:04 +00:00
README.md Revert system included facilitynames 2019年03月18日 22:32:38 +00:00

What it is

This library provides command line parsing functions with several improvements over the POSIX getopt(3) call:

  • command processing is done through callbacks rather than if-else,
  • all data is kept in one structure,
  • default callbacks for on/off flag, string, integer, float, and log parameters,
  • built-in help and version renderer with word breaking,
  • built-in error message display.

Compiling

gcc -Wall -s -O2 -shared -fPIC -olibarguments.so arguments.c -lm

or you can use

gcc -DSYSLOG_NAMES=1 -Wall -s -O2 -shared -fPIC -olibarguments.so arguments.c -lm

if the facilitynames structure is defined in your syslog.h. This provides syslog facility identifiers to be used with argument_log tailored to your system.

Installing

  1. Copy the resulting libarguments.so to the chosen lib directory.
  2. Copy arguments.h to the corresponding include directory.
  3. Deploy manual pages.

Using

Please refer to the manual pages provided.