diff options
author | René Scharfe <rene.scharfe@lsrfire.ath.cx> | 2011-09-28 19:44:30 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-09-28 12:46:21 -0700 |
commit | 6acec0380bfcd5e3f91c9100bf4d415db8f7acfd (patch) | |
tree | 16f376495294910ce5ab5b52415a4e8a774d5936 /test-parse-options.c | |
parent | archive.c: use OPT_BOOL() (diff) | |
download | tgif-6acec0380bfcd5e3f91c9100bf4d415db8f7acfd.tar.xz |
parseopt: add OPT_NOOP_NOARG
Add OPT_NOOP_NOARG, a helper macro to define deprecated options in a
standard way. The help text is taken from the no-op option -r of
git revert.
The callback could be made to emit a (conditional?) warning later. And
we could also add OPT_NOOP (requiring an argument) etc. as needed.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'test-parse-options.c')
-rw-r--r-- | test-parse-options.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/test-parse-options.c b/test-parse-options.c index 91a5701657..36487c402b 100644 --- a/test-parse-options.c +++ b/test-parse-options.c @@ -54,6 +54,7 @@ int main(int argc, const char **argv) OPT_STRING(0, "string2", &string, "str", "get another string"), OPT_STRING(0, "st", &string, "st", "get another string (pervert ordering)"), OPT_STRING('o', NULL, &string, "str", "get another string"), + OPT_NOOP_NOARG(0, "obsolete"), OPT_SET_PTR(0, "default-string", &string, "set string to default", (unsigned long)"default"), OPT_STRING_LIST(0, "list", &list, "str", "add str to list"), |