4 * Copyright (c) Tuomo Valkonen 1999-2002.
6 * You may distribute and modify this library under the terms of either
7 * the Clarified Artistic License or the GNU LGPL, version 2.1 or later.
14 #include "optparser.h"
17 static const char usage
[]=
18 "Usage: $p [options]\n"
20 "Where options are:\n"
24 static OptParserOpt opts
[]={
25 {'o', "opt", OPT_ARG
, "OPTION", "foo bar baz quk asdf jklö äölk dfgh quik aaaa bbbb cccc dddd eeee ffff"},
26 {'f', "file", OPT_ARG
, "FILE", "asdfsadlfölökjasdflökjasdflkjöasdflkjöas dlöfjkasdfölkjasdfölkjasdfasdflöjasdfkasödjlfkasdlföjasdölfjkölkasjdfasdfölkjasd asdöljfasöldf asdölfköasdlf asfdlök asdföljkadsfölasdfölasdölkfjasdölfasödlflöskflasdföaölsdf"},
27 {'v', "view", 0, NULL
, "asfasdf"},
28 {'z', "zip", 0, NULL
, "asdfasdf"},
29 {'x', "extract", 0, NULL
, "asdfasdf"},
30 {0, NULL
, 0, NULL
, NULL
}
33 static OptParserCommonInfo tester3_cinfo
={
40 int main(int argc
, char *argv
[])
46 optparser_init(argc
, argv
, OPTP_NO_DASH
, opts
, &tester3_cinfo
);
48 while((opt
=optparser_get_opt())){
51 printf("opt: %s\n", optparser_get_arg());
54 printf("file: %s\n", optparser_get_arg());
66 optparser_print_error();