describe: add example

This commit is contained in:
Linquize
2014-10-12 15:52:53 +08:00
parent 9e49cb7a4b
commit d6bbcefce3
3 changed files with 198 additions and 0 deletions

View File

@@ -46,6 +46,15 @@ struct args_info {
};
#define ARGS_INFO_INIT { argc, argv, 0 }
/**
* Check current `args` entry against `opt` string. If it matches
* exactly, take the next arg as a string; if it matches as a prefix with
* an equal sign, take the remainder as a string; if value not supplied,
* default value `def` will be given. otherwise return 0.
*/
extern int optional_str_arg(
const char **out, struct args_info *args, const char *opt, const char *def);
/**
* Check current `args` entry against `opt` string. If it matches
* exactly, take the next arg as a string; if it matches as a prefix with