Skip to content

Commit fd03881

Browse files
René Scharfegitster
authored andcommitted
add description parameter to OPT__VERBOSE
Allows better help text to be defined than "be verbose". Also make use of the macro in places 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>
1 parent 6f10c41 commit fd03881

File tree

16 files changed

+17
-17
lines changed

16 files changed

+17
-17
lines changed

Documentation/technical/api-parse-options.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ There are some macros to easily define options:
124124
`OPT__QUIET(&int_var)`::
125125
Add `-q, \--quiet`.
126126

127-
`OPT__VERBOSE(&int_var)`::
127+
`OPT__VERBOSE(&int_var, description)`::
128128
Add `-v, \--verbose`.
129129

130130
`OPT_GROUP(description)`::

archive.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ static int parse_archive_args(int argc, const char **argv,
314314
"write the archive to this file"),
315315
OPT_BOOLEAN(0, "worktree-attributes", &worktree_attributes,
316316
"read .gitattributes in working directory"),
317-
OPT__VERBOSE(&verbose),
317+
OPT__VERBOSE(&verbose, "be verbose"),
318318
OPT__COMPR('0', &compression_level, "store only", 0),
319319
OPT__COMPR('1', &compression_level, "compress faster", 1),
320320
OPT__COMPR_HIDDEN('2', &compression_level, 2),

builtin/add.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ static int ignore_add_errors, addremove, intent_to_add, ignore_missing = 0;
314314

315315
static struct option builtin_add_options[] = {
316316
OPT__DRY_RUN(&show_only),
317-
OPT__VERBOSE(&verbose),
317+
OPT__VERBOSE(&verbose, "be verbose"),
318318
OPT_GROUP(""),
319319
OPT_BOOLEAN('i', "interactive", &add_interactive, "interactive picking"),
320320
OPT_BOOLEAN('p', "patch", &patch_interactive, "interactive patching"),

builtin/apply.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3843,7 +3843,7 @@ int cmd_apply(int argc, const char **argv, const char *prefix_)
38433843
"don't expect at least one line of context"),
38443844
OPT_BOOLEAN(0, "reject", &apply_with_reject,
38453845
"leave the rejected hunks in corresponding *.rej files"),
3846-
OPT__VERBOSE(&apply_verbosely),
3846+
OPT__VERBOSE(&apply_verbosely, "be verbose"),
38473847
OPT_BIT(0, "inaccurate-eof", &options,
38483848
"tolerate incorrectly detected missing new-line at the end of file",
38493849
INACCURATE_EOF),

builtin/branch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
621621

622622
struct option options[] = {
623623
OPT_GROUP("Generic options"),
624-
OPT__VERBOSE(&verbose),
624+
OPT__VERBOSE(&verbose, "be verbose"),
625625
OPT_SET_INT('t', "track", &track, "set up tracking mode (see git-pull(1))",
626626
BRANCH_TRACK_EXPLICIT),
627627
OPT_SET_INT( 0, "set-upstream", &track, "change upstream info",

builtin/commit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ static int opt_parse_m(const struct option *opt, const char *arg, int unset)
115115

116116
static struct option builtin_commit_options[] = {
117117
OPT__QUIET(&quiet),
118-
OPT__VERBOSE(&verbose),
118+
OPT__VERBOSE(&verbose, "be verbose"),
119119

120120
OPT_GROUP("Commit message options"),
121121
OPT_FILENAME('F', "file", &logfile, "read log from file"),
@@ -1048,7 +1048,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
10481048
int fd;
10491049
unsigned char sha1[20];
10501050
static struct option builtin_status_options[] = {
1051-
OPT__VERBOSE(&verbose),
1051+
OPT__VERBOSE(&verbose, "be verbose"),
10521052
OPT_SET_INT('s', "short", &status_format,
10531053
"show status concisely", STATUS_FORMAT_SHORT),
10541054
OPT_BOOLEAN('b', "branch", &status_show_branch,

builtin/count-objects.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ int cmd_count_objects(int argc, const char **argv, const char *prefix)
7979
unsigned long loose = 0, packed = 0, packed_loose = 0, garbage = 0;
8080
off_t loose_size = 0;
8181
struct option opts[] = {
82-
OPT__VERBOSE(&verbose),
82+
OPT__VERBOSE(&verbose, "be verbose"),
8383
OPT_END(),
8484
};
8585

builtin/fsck.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ static char const * const fsck_usage[] = {
572572
};
573573

574574
static struct option fsck_opts[] = {
575-
OPT__VERBOSE(&verbose),
575+
OPT__VERBOSE(&verbose, "be verbose"),
576576
OPT_BOOLEAN(0, "unreachable", &show_unreachable, "show unreachable objects"),
577577
OPT_BOOLEAN(0, "tags", &show_tags, "report tags"),
578578
OPT_BOOLEAN(0, "root", &show_root, "report root nodes"),

builtin/log.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1365,7 +1365,7 @@ int cmd_cherry(int argc, const char **argv, const char *prefix)
13651365

13661366
struct option options[] = {
13671367
OPT__ABBREV(&abbrev),
1368-
OPT__VERBOSE(&verbose),
1368+
OPT__VERBOSE(&verbose, "be verbose"),
13691369
OPT_END()
13701370
};
13711371

builtin/notes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ static int prune(int argc, const char **argv, const char *prefix)
806806
struct option options[] = {
807807
OPT_BOOLEAN('n', "dry-run", &show_only,
808808
"do not remove, show only"),
809-
OPT_BOOLEAN('v', "verbose", &verbose, "report pruned notes"),
809+
OPT__VERBOSE(&verbose, "report pruned notes"),
810810
OPT_END()
811811
};
812812

0 commit comments

Comments
 (0)