shared/options: introduce OPTION_ERROR
[zjs: this was originally proposed in https://github.com/systemd/systemd/commit/930fc9d6980f27b278527b0d6117f97296fcaf6a. I'm rescuing one chunk from that patch.]
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
953ff3c83e
commit
2289ac82d4
@@ -80,6 +80,10 @@ typedef struct Option {
|
||||
#define OPTION_POSITIONAL OPTION_FULL(OPTION_POSITIONAL_ENTRY, /* sc= */ 0, "(positional)", /* mv= */ NULL, /* h= */ NULL)
|
||||
#define OPTION_HELP_VERBATIM(lc, h) OPTION_FULL(OPTION_HELP_ENTRY_VERBATIM, /* sc= */ 0, lc, /* mv= */ NULL, h)
|
||||
|
||||
/* This can be used when custom error handling is needed. */
|
||||
#define OPTION_ERROR \
|
||||
case INT_MIN ... -1
|
||||
|
||||
#define OPTION_COMMON_HELP \
|
||||
OPTION('h', "help", NULL, "Show this help")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user