|
|
Normally, Args treats each command line argument to the right of the first (non-option) argument as a (non-option) argument, regardless of whether it starts with a flag. Thus, if our current program is invoked with
cc -c foo.c -O
then -O is treated as an argument, not as the -O option. However, if intermixing of options and arguments is desired, this can be specified:
Args args(argc, argv, "co:OI:D;", Args::intermix);
Now the above invocation will be interpreted the same as
cc -c -O foo.c
Regardless of whether intermixing is chosen, the special option -- can always be used to indicate that all command line arguments to the right are to be treated as (non-option) arguments, regardless of whether they start with a flag. For example, even under intermixing, the following invocation
cc -c -- -p foo.c -O
treats -p and -O as (non-option) arguments.