summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e21adb8)
raw | patch | inline | side by side (parent: e21adb8)
author | René Scharfe <rene.scharfe@lsrfire.ath.cx> | |
Mon, 8 Nov 2010 18:06:54 +0000 (19:06 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 15 Nov 2010 17:58:13 +0000 (09:58 -0800) |
Allows better help text to be defined than "be quiet". Also make use
of the macro in a place that already had a different description. No
object code changes intended.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
of the macro in a place that already had a different description. No
object code changes intended.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 files changed:
diff --git a/Documentation/technical/api-parse-options.txt b/Documentation/technical/api-parse-options.txt
index 00c447c74c7d5df85b0521f2fc90b12470a5950f..248a66dffb04a24b0c870ca60030b384ab72a862 100644 (file)
`OPT__DRY_RUN(&int_var, description)`::
Add `-n, \--dry-run`.
-`OPT__QUIET(&int_var)`::
+`OPT__QUIET(&int_var, description)`::
Add `-q, \--quiet`.
`OPT__VERBOSE(&int_var, description)`::
index 65cbee0552b8e2d5ed7cfd57781031d72c1cdd98..7ba09130cc2d1e9e3043ab867823b50e6227e2de 100644 (file)
--- a/builtin/checkout-index.c
+++ b/builtin/checkout-index.c
"checks out all files in the index"),
OPT_BOOLEAN('f', "force", &force,
"forces overwrite of existing files"),
- OPT__QUIET(&quiet),
+ OPT__QUIET(&quiet, "be quiet"),
OPT_BOOLEAN('n', "no-create", ¬_new,
"don't checkout new files"),
{ OPTION_CALLBACK, 'u', "index", &newfd, NULL,
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 9240fafb2ad17505bf407363e058d208a8a70497..a952477d19608a4324b5a141c7740d9ab5ed16c2 100644 (file)
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
int patch_mode = 0;
int dwim_new_local_branch = 1;
struct option options[] = {
- OPT__QUIET(&opts.quiet),
+ OPT__QUIET(&opts.quiet, "be quiet"),
OPT_STRING('b', NULL, &opts.new_branch, "branch",
"create and checkout a new branch"),
OPT_STRING('B', NULL, &opts.new_branch_force, "branch",
diff --git a/builtin/clean.c b/builtin/clean.c
index 17ecbe6eea5139c4a10cece3b4798ea188ac159e..449d2a3237637f07258ca9a5ee5423790d587a82 100644 (file)
--- a/builtin/clean.c
+++ b/builtin/clean.c
const char *qname;
char *seen = NULL;
struct option options[] = {
- OPT__QUIET(&quiet),
+ OPT__QUIET(&quiet, "be quiet"),
OPT__DRY_RUN(&show_only, "dry run"),
OPT_BOOLEAN('f', "force", &force, "force"),
OPT_BOOLEAN('d', NULL, &remove_directories,
diff --git a/builtin/commit.c b/builtin/commit.c
index 9cbc4eadd99c8bb02dd647032d17d2a76d8d2d34..97ae1bca4bff3cf6ef08b7f54be1ee901a5e0c1f 100644 (file)
--- a/builtin/commit.c
+++ b/builtin/commit.c
}
static struct option builtin_commit_options[] = {
- OPT__QUIET(&quiet),
+ OPT__QUIET(&quiet, "be quiet"),
OPT__VERBOSE(&verbose, "be verbose"),
OPT_GROUP("Commit message options"),
diff --git a/builtin/gc.c b/builtin/gc.c
index c304638b7845601f184149d3c48cbc1ea1e195f5..8f673253708c9d5de42e02c381ec4cc75fb10a0b 100644 (file)
--- a/builtin/gc.c
+++ b/builtin/gc.c
char buf[80];
struct option builtin_gc_options[] = {
- OPT__QUIET(&quiet),
+ OPT__QUIET(&quiet, "be quiet"),
{ OPTION_STRING, 0, "prune", &prune_expire, "date",
"prune unreferenced objects",
PARSE_OPT_OPTARG, NULL, (intptr_t)prune_expire },
diff --git a/builtin/grep.c b/builtin/grep.c
index 3d5f6ace97b806fd7dba9f8c5d62abcdbd903681..adb542494dde32123011b1e76ed164ab39e6e716 100644 (file)
--- a/builtin/grep.c
+++ b/builtin/grep.c
{ OPTION_CALLBACK, ')', NULL, &opt, NULL, "",
PARSE_OPT_NOARG | PARSE_OPT_NONEG | PARSE_OPT_NODASH,
close_callback },
- OPT_BOOLEAN('q', "quiet", &opt.status_only,
- "indicate hit with exit status without output"),
+ OPT__QUIET(&opt.status_only,
+ "indicate hit with exit status without output"),
OPT_BOOLEAN(0, "all-match", &opt.all_match,
"show only matches from files that match all patterns"),
OPT_GROUP(""),
diff --git a/builtin/merge-file.c b/builtin/merge-file.c
index b6664d49be9454b703615af4e71f92231e053e07..58e473141c1828b81957332bea4e13132c00f686 100644 (file)
--- a/builtin/merge-file.c
+++ b/builtin/merge-file.c
XDL_MERGE_FAVOR_UNION),
OPT_INTEGER(0, "marker-size", &xmp.marker_size,
"for conflicts, use this marker size"),
- OPT__QUIET(&quiet),
+ OPT__QUIET(&quiet, "be quiet"),
OPT_CALLBACK('L', NULL, names, "name",
"set labels for file1/orig_file/file2", &label_cb),
OPT_END(),
diff --git a/builtin/reset.c b/builtin/reset.c
index 0037be4693bbd875e644df13ce4a9fae31e7378c..d6242071ba7a81f83c59e40d026e578b051ea3ba 100644 (file)
--- a/builtin/reset.c
+++ b/builtin/reset.c
struct commit *commit;
char *reflog_action, msg[1024];
const struct option options[] = {
- OPT__QUIET(&quiet),
+ OPT__QUIET(&quiet, "be quiet"),
OPT_SET_INT(0, "mixed", &reset_type,
"reset HEAD and index", MIXED),
OPT_SET_INT(0, "soft", &reset_type, "reset only HEAD", SOFT),
diff --git a/builtin/rm.c b/builtin/rm.c
index 26b7412aaa2d365d4e28093f1cb8e2343e3c6135..49461b60c75d214a72cb1882c0d2f0c265e59ab5 100644 (file)
--- a/builtin/rm.c
+++ b/builtin/rm.c
static struct option builtin_rm_options[] = {
OPT__DRY_RUN(&show_only, "dry run"),
- OPT__QUIET(&quiet),
+ OPT__QUIET(&quiet, "be quiet"),
OPT_BOOLEAN( 0 , "cached", &index_only, "only remove from the index"),
OPT_BOOLEAN('f', "force", &force, "override the up-to-date check"),
OPT_BOOLEAN('r', NULL, &recursive, "allow recursive removal"),
diff --git a/builtin/show-ref.c b/builtin/show-ref.c
index be9b512eebc72984e6ff4cdd4859ab7951539e19..6507f03d32a97efab7d073f68c0e65f10a2857c4 100644 (file)
--- a/builtin/show-ref.c
+++ b/builtin/show-ref.c
"only show SHA1 hash using <n> digits",
PARSE_OPT_OPTARG, &hash_callback },
OPT__ABBREV(&abbrev),
- OPT__QUIET(&quiet),
+ OPT__QUIET(&quiet, "be quiet"),
{ OPTION_CALLBACK, 0, "exclude-existing", &exclude_existing_arg,
"pattern", "show refs from stdin that aren't in local repository",
PARSE_OPT_OPTARG | PARSE_OPT_NONEG, exclude_existing_callback },
diff --git a/builtin/symbolic-ref.c b/builtin/symbolic-ref.c
index ca855a5eb239f4dadccd53369e38db4e78b1d13f..1b284253f2bfcf608548d9f7ab19c82ac356e24e 100644 (file)
--- a/builtin/symbolic-ref.c
+++ b/builtin/symbolic-ref.c
int quiet = 0;
const char *msg = NULL;
struct option options[] = {
- OPT__QUIET(&quiet),
+ OPT__QUIET(&quiet, "be quiet"),
OPT_STRING('m', NULL, &msg, "reason", "reason of the update"),
OPT_END(),
};
diff --git a/parse-options.h b/parse-options.h
index 69ce09415890ca38330a3e98b15d2c3d61b2fa6d..3dd3a94f22b23ffe9127aba3a90fe66c3ebc45f1 100644 (file)
--- a/parse-options.h
+++ b/parse-options.h
extern int parse_opt_tertiary(const struct option *, const char *, int);
#define OPT__VERBOSE(var, h) OPT_BOOLEAN('v', "verbose", (var), (h))
-#define OPT__QUIET(var) OPT_BOOLEAN('q', "quiet", (var), "be quiet")
+#define OPT__QUIET(var, h) OPT_BOOLEAN('q', "quiet", (var), (h))
#define OPT__VERBOSITY(var) \
{ OPTION_CALLBACK, 'v', "verbose", (var), NULL, "be more verbose", \
PARSE_OPT_NOARG, &parse_opt_verbosity_cb, 0 }, \
diff --git a/test-parse-options.c b/test-parse-options.c
index cddd10643f3bc6362dd8a40637b432f94d81999a..0828592162cc7c61f0d025ba4d83fc29bc4c2067 100644 (file)
--- a/test-parse-options.c
+++ b/test-parse-options.c
OPT__ABBREV(&abbrev),
OPT__VERBOSE(&verbose, "be verbose"),
OPT__DRY_RUN(&dry_run, "dry run"),
- OPT__QUIET(&quiet),
+ OPT__QUIET(&quiet, "be quiet"),
OPT_END(),
};
int i;