Closed janwilmans closed 4 years ago
ok, so the problem here was, that the options I was combining were on listed on the same line in the Usage specification. So this is apparently interpreted as 'not to be used together', but the error message 'Unexpected argument' would be more clear if it said something like 'options cannot be used together '-d , -a '.
The example below works in all combinations that I have tried, however, the -a option changed, so I tested with the combination of -d and -i
static const char USAGE[] =
R"(DebugviewConsole )" VERSION_STR
R"(
Usage:
DebugviewConsole [-acflsqtpnv] [-d <file>] [-i <pattern>, --include <pattern>]... [-e <pattern>, --exclude <pattern>]...
DebugviewConsole (-h | --help)
DebugviewConsole [-x]
DebugviewConsole [-u]
Options:
-h, --help show this screen
-i <pattern>, --include <pattern> include filter, may be specified multiple times
-e <pattern>, --exclude <pattern> exclude filter, may be specified multiple times
-a auto-newline, most people want this
-c enable console output
-d <file> write to .dblog file
-v verbose
Console options: (no effect on .dblog file)
-l prefix line number
-s prefix messages with system time
-q prefix message with high-precision (<1us) offset from QueryPerformanceCounter
-t tab-separated output
-p add PID (process ID)
-n add process name
Advanced options:
-f aggressively flush buffers, if unsure, do not use
-x stop all running debugviewconsole instances
-u send a UDP test-message, used only for debugging
)";
If it is normal behaviour that options from different lines are not to be used together, and there is no interest to improve the error message, this issue can be closed.
That looks like expected behaviour to me. There's already a few issues open that discuss error messages.
Yes, this is expected behavior. This is to support cases where you want certain options to work together (eg, for a given command) and others to not work together.
In this example:
works
works, however, the combination:
does not work