diff options
author | ewt <ewt> | 1998-09-27 15:56:18 +0000 |
---|---|---|
committer | ewt <ewt> | 1998-09-27 15:56:18 +0000 |
commit | b211c63a4bcdae7cbb706d2d29bd4ce649765efd (patch) | |
tree | 6abfd192841c74b35dc05f9b12effd6789e16eff /test1.c | |
parent | 1368cd6128ccc5c7c7b3a03adb9045613acc6dd9 (diff) | |
download | libpopt-b211c63a4bcdae7cbb706d2d29bd4ce649765efd.tar.gz |
1) modified test to display callback val field
2) split popt stuff into multiple iles
Diffstat (limited to 'test1.c')
-rw-r--r-- | test1.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -3,8 +3,9 @@ #include "popt.h" -void option_callback(poptContext con, int key, char * arg, void * data) { - printf("callback: %s %s ", (char *) data, arg); +void option_callback(poptContext con, const struct poptOption * opt, + char * arg, void * data) { + printf("callback: %c %s %s ", opt->val, (char *) data, arg); } int main(int argc, char ** argv) { @@ -19,8 +20,8 @@ int main(int argc, char ** argv) { int usage = 0; struct poptOption callbackArgs[] = { { NULL, '\0', POPT_ARG_CALLBACK, option_callback, 0, "sampledata" }, - { "cb", 'c', POPT_ARG_STRING, NULL, 0, "Test argument callbacks" }, - { "long", '\0', 0, NULL, 0, "Unused option for help testing" }, + { "cb", 'c', POPT_ARG_STRING, NULL, 'c', "Test argument callbacks" }, + { "long", '\0', 0, NULL, 'l', "Unused option for help testing" }, { NULL, '\0', 0, NULL, 0 } }; struct poptOption moreArgs[] = { |