summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6f10c41)
raw | patch | inline | side by side (parent: 6f10c41)
author | René Scharfe <rene.scharfe@lsrfire.ath.cx> | |
Mon, 8 Nov 2010 17:56:39 +0000 (18:56 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 15 Nov 2010 17:56:51 +0000 (09:56 -0800) |
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>
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>
16 files changed:
diff --git a/Documentation/technical/api-parse-options.txt b/Documentation/technical/api-parse-options.txt
index c5d141cd63d15e97dd4b4777c30dccb57d430782..969489bbe52c66073e9b9ab32dfb09b7e7c41b9e 100644 (file)
`OPT__QUIET(&int_var)`::
Add `-q, \--quiet`.
-`OPT__VERBOSE(&int_var)`::
+`OPT__VERBOSE(&int_var, description)`::
Add `-v, \--verbose`.
`OPT_GROUP(description)`::
diff --git a/archive.c b/archive.c
index f59afda6ffda02920a50cabe1eb3e764221199ba..78a67f0cf1546f641092d8b84351762f7aee2185 100644 (file)
--- a/archive.c
+++ b/archive.c
"write the archive to this file"),
OPT_BOOLEAN(0, "worktree-attributes", &worktree_attributes,
"read .gitattributes in working directory"),
- OPT__VERBOSE(&verbose),
+ OPT__VERBOSE(&verbose, "be verbose"),
OPT__COMPR('0', &compression_level, "store only", 0),
OPT__COMPR('1', &compression_level, "compress faster", 1),
OPT__COMPR_HIDDEN('2', &compression_level, 2),
diff --git a/builtin/add.c b/builtin/add.c
index 56a4e0af6b35ea9f6d86accad27a1c87bc5ad0d9..fbf14035c32ce7eaf0659ff5dee73f7e6b54e8bb 100644 (file)
--- a/builtin/add.c
+++ b/builtin/add.c
static struct option builtin_add_options[] = {
OPT__DRY_RUN(&show_only),
- OPT__VERBOSE(&verbose),
+ OPT__VERBOSE(&verbose, "be verbose"),
OPT_GROUP(""),
OPT_BOOLEAN('i', "interactive", &add_interactive, "interactive picking"),
OPT_BOOLEAN('p', "patch", &patch_interactive, "interactive patching"),
diff --git a/builtin/apply.c b/builtin/apply.c
index 23c18c573b9147b7aaa88a8d1d2f26748e803501..e1e9ecc815ad2bf2993ee3da0b6c245f0bffeb09 100644 (file)
--- a/builtin/apply.c
+++ b/builtin/apply.c
"don't expect at least one line of context"),
OPT_BOOLEAN(0, "reject", &apply_with_reject,
"leave the rejected hunks in corresponding *.rej files"),
- OPT__VERBOSE(&apply_verbosely),
+ OPT__VERBOSE(&apply_verbosely, "be verbose"),
OPT_BIT(0, "inaccurate-eof", &options,
"tolerate incorrectly detected missing new-line at the end of file",
INACCURATE_EOF),
diff --git a/builtin/branch.c b/builtin/branch.c
index 87976f0921d87f2a8564eb54aa3b81d30ee7f214..10788fc1dd134aa9c9f6ef81fbc3b681b23718b0 100644 (file)
--- a/builtin/branch.c
+++ b/builtin/branch.c
struct option options[] = {
OPT_GROUP("Generic options"),
- OPT__VERBOSE(&verbose),
+ OPT__VERBOSE(&verbose, "be verbose"),
OPT_SET_INT('t', "track", &track, "set up tracking mode (see git-pull(1))",
BRANCH_TRACK_EXPLICIT),
OPT_SET_INT( 0, "set-upstream", &track, "change upstream info",
diff --git a/builtin/commit.c b/builtin/commit.c
index 66fdd2202495b2893c79b4f92b0fc2e715f5b7bb..9cbc4eadd99c8bb02dd647032d17d2a76d8d2d34 100644 (file)
--- a/builtin/commit.c
+++ b/builtin/commit.c
static struct option builtin_commit_options[] = {
OPT__QUIET(&quiet),
- OPT__VERBOSE(&verbose),
+ OPT__VERBOSE(&verbose, "be verbose"),
OPT_GROUP("Commit message options"),
OPT_FILENAME('F', "file", &logfile, "read log from file"),
int fd;
unsigned char sha1[20];
static struct option builtin_status_options[] = {
- OPT__VERBOSE(&verbose),
+ OPT__VERBOSE(&verbose, "be verbose"),
OPT_SET_INT('s', "short", &status_format,
"show status concisely", STATUS_FORMAT_SHORT),
OPT_BOOLEAN('b', "branch", &status_show_branch,
index 2bdd8ebde1002e852055385396ef053f26c91ae8..c37cb98c31ddfaa90d38a0355d32cf3d6c404bff 100644 (file)
--- a/builtin/count-objects.c
+++ b/builtin/count-objects.c
unsigned long loose = 0, packed = 0, packed_loose = 0, garbage = 0;
off_t loose_size = 0;
struct option opts[] = {
- OPT__VERBOSE(&verbose),
+ OPT__VERBOSE(&verbose, "be verbose"),
OPT_END(),
};
diff --git a/builtin/fsck.c b/builtin/fsck.c
index 0929c7f245cbe85a4a68374850871a0ffbcdeec3..6d5ebca7a9bc9333ea8e493057ecce1b4814c252 100644 (file)
--- a/builtin/fsck.c
+++ b/builtin/fsck.c
};
static struct option fsck_opts[] = {
- OPT__VERBOSE(&verbose),
+ OPT__VERBOSE(&verbose, "be verbose"),
OPT_BOOLEAN(0, "unreachable", &show_unreachable, "show unreachable objects"),
OPT_BOOLEAN(0, "tags", &show_tags, "report tags"),
OPT_BOOLEAN(0, "root", &show_root, "report root nodes"),
diff --git a/builtin/log.c b/builtin/log.c
index 22d12903ac06597979f30d0fd94267fc543afa29..d0297a1c5e563bc99cb9cd3d52f7017348980ec9 100644 (file)
--- a/builtin/log.c
+++ b/builtin/log.c
struct option options[] = {
OPT__ABBREV(&abbrev),
- OPT__VERBOSE(&verbose),
+ OPT__VERBOSE(&verbose, "be verbose"),
OPT_END()
};
diff --git a/builtin/notes.c b/builtin/notes.c
index 6d07aac80cc2bfd042eee905abb5086a29e1d90a..e0a1f62fc9eb0ee6a1943e7a3438e1077a666cb9 100644 (file)
--- a/builtin/notes.c
+++ b/builtin/notes.c
struct option options[] = {
OPT_BOOLEAN('n', "dry-run", &show_only,
"do not remove, show only"),
- OPT_BOOLEAN('v', "verbose", &verbose, "report pruned notes"),
+ OPT__VERBOSE(&verbose, "report pruned notes"),
OPT_END()
};
diff --git a/builtin/prune.c b/builtin/prune.c
index 99218ba49e2c6ea7ff7185e6397bb73bca213a66..8b770affff34d816a9fc4fe02b60787cb3d7675a 100644 (file)
--- a/builtin/prune.c
+++ b/builtin/prune.c
const struct option options[] = {
OPT_BOOLEAN('n', "dry-run", &show_only,
"do not remove, show only"),
- OPT_BOOLEAN('v', "verbose", &verbose, "report pruned objects"),
+ OPT__VERBOSE(&verbose, "report pruned objects"),
OPT_DATE(0, "expire", &expire,
"expire objects older than <time>"),
OPT_END()
diff --git a/builtin/read-tree.c b/builtin/read-tree.c
index eb1e3e7467ac722f4b6cc1da03f7671d21abc676..73c89ed15ba2fb0c470141499c3390b77cf1d81c 100644 (file)
--- a/builtin/read-tree.c
+++ b/builtin/read-tree.c
PARSE_OPT_NONEG, index_output_cb },
OPT_SET_INT(0, "empty", &read_empty,
"only empty the index", 1),
- OPT__VERBOSE(&opts.verbose_update),
+ OPT__VERBOSE(&opts.verbose_update, "be verbose"),
OPT_GROUP("Merging"),
OPT_SET_INT('m', NULL, &opts.merge,
"perform a merge in addition to a read", 1),
diff --git a/builtin/remote.c b/builtin/remote.c
index e9a6e09257f445b1c26833dd9fae89518369daa7..b944b91056b7b2bce00844e0c9575f83f8f97b42 100644 (file)
--- a/builtin/remote.c
+++ b/builtin/remote.c
int cmd_remote(int argc, const char **argv, const char *prefix)
{
struct option options[] = {
- OPT_BOOLEAN('v', "verbose", &verbose, "be verbose; must be placed before a subcommand"),
+ OPT__VERBOSE(&verbose, "be verbose; must be placed before a subcommand"),
OPT_END()
};
int result;
diff --git a/builtin/verify-tag.c b/builtin/verify-tag.c
index 9f482c29f516bde84023f401b28b133c1e605333..6784846ec9a1cfe9e6155e5916eaf26b3e111cd5 100644 (file)
--- a/builtin/verify-tag.c
+++ b/builtin/verify-tag.c
{
int i = 1, verbose = 0, had_error = 0;
const struct option verify_tag_options[] = {
- OPT__VERBOSE(&verbose),
+ OPT__VERBOSE(&verbose, "be verbose"),
OPT_END()
};
diff --git a/parse-options.h b/parse-options.h
index d982f0f1bf181f00f54861eb768504007490e95d..14918b16e5e904581032a92466468c15a3639417 100644 (file)
--- a/parse-options.h
+++ b/parse-options.h
extern int parse_opt_with_commit(const struct option *, const char *, int);
extern int parse_opt_tertiary(const struct option *, const char *, int);
-#define OPT__VERBOSE(var) OPT_BOOLEAN('v', "verbose", (var), "be verbose")
+#define OPT__VERBOSE(var, h) OPT_BOOLEAN('v', "verbose", (var), (h))
#define OPT__QUIET(var) OPT_BOOLEAN('q', "quiet", (var), "be quiet")
#define OPT__VERBOSITY(var) \
{ OPTION_CALLBACK, 'v', "verbose", (var), NULL, "be more verbose", \
diff --git a/test-parse-options.c b/test-parse-options.c
index acd1a2ba70fc2ffb38cd8fb0784aa6e5e693183f..bd7b8a4ea809a56ccb0240d00043fea7acbd5884 100644 (file)
--- a/test-parse-options.c
+++ b/test-parse-options.c
"negative ambiguity", PARSE_OPT_NOARG | PARSE_OPT_NONEG },
OPT_GROUP("Standard options"),
OPT__ABBREV(&abbrev),
- OPT__VERBOSE(&verbose),
+ OPT__VERBOSE(&verbose, "be verbose"),
OPT__DRY_RUN(&dry_run),
OPT__QUIET(&quiet),
OPT_END(),