1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
This one is from a C++ program
Try to launch me with some options
(type sample1 --help for the complete list)
For example: ./sample1 *.* --funct-opt
Here are the options you passed...
file: cmdline1.c
file: cmdline2.c
This is the integer you input: 10.
The flag option was given!
The flag is on.
Hello! Have a nice day! :-)
This one is from a C++ program
Try to launch me with some options
(type sample1 --help for the complete list)
For example: ./sample1 *.* --funct-opt
Usage: sample1 -iINT|--int-opt=INT [-h|--help] [--detailed-help] [--full-help]
[-V|--version] [-sfilename|--str-opt=filename] [-mINT|--my-opt=INT]
[--flag-opt] [-F|--funct-opt] [--long-opt=LONG] [--def-opt=STRING]
[--enum-opt=STRING] [-DINT|--dependant=INT] [FILE]...
-h, --help Print help and exit
--detailed-help Print help, including all details and hidden options,
and exit
--full-help Print help, including hidden options, and exit
-V, --version Print version and exit
-s, --str-opt=filename A string option, for a filename
A brief text description before the other options.
-m, --my-opt=INT Another integer option, this time the description of
the option should be "quite" long to require
wrapping... possibly more than one wrapping :-)
especially if I
require a line break
-i, --int-opt=INT A int option (mandatory)
more involved options:
the following options
are more complex
--flag-opt A flag option (default=off)
-F, --funct-opt A function option
last option section:
--long-opt=LONG A long option
--def-opt=STRING A string option with default (default=`Hello')
--enum-opt=STRING A string option with list of values (possible
values="foo", "bar", "hello", "bye"
default=`hello')
-D, --dependant=INT option that depends on str-opt
An ending text.
Here is the version
GNU gengetopt 2.0
This is a simple test for gengetopt
Usage: sample2 [OPTION]... [FILE]...
this is just a test program for gengetopt
-h, --help Print help and exit
--full-help Print help, including hidden options, and exit
-V, --version Print version and exit
-s, --str-opt=STRING A string option
-i, --int-opt=INT A int option
-S, --short-opt=SHORT A short option
-l, --long-opt=LONG A long option
-f, --float-opt=FLOAT A float option
-d, --double-opt=DOUBLE A double option
-L, --long-double-opt=LONGDOUBLE
A long double option
-y, --long-long-opt=LONGLONG A long long option
-F, --func-opt A function option
-x, --flag-opt A flag option (default=off)
|