From 9c9b4f2f8b7f27f3984e80d053106d5d41cbb03b Mon Sep 17 00:00:00 2001 From: Alex Henrie Date: Tue, 13 Jan 2015 00:44:47 -0700 Subject: [PATCH] standardize usage info string format This patch puts the usage info strings that were not already in docopt- like format into docopt-like format, which will be a litle easier for end users and a lot easier for translators. Changes include: - Placing angle brackets around fill-in-the-blank parameters - Putting dashes in multiword parameter names - Adding spaces to [-f|--foobar] to make [-f | --foobar] - Replacing * with [...] Signed-off-by: Alex Henrie Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- Documentation/CodingGuidelines | 8 ++++++-- advice.c | 2 +- archive.c | 4 ++-- builtin/add.c | 2 +- builtin/apply.c | 2 +- builtin/blame.c | 4 ++-- builtin/branch.c | 8 ++++---- builtin/cat-file.c | 4 ++-- builtin/check-attr.c | 4 ++-- builtin/check-ignore.c | 4 ++-- builtin/check-mailmap.c | 2 +- builtin/check-ref-format.c | 2 +- builtin/checkout-index.c | 2 +- builtin/checkout.c | 8 ++++---- builtin/clone.c | 2 +- builtin/column.c | 2 +- builtin/commit.c | 4 ++-- builtin/config.c | 2 +- builtin/describe.c | 4 ++-- builtin/diff-files.c | 2 +- builtin/diff-index.c | 2 +- builtin/diff-tree.c | 2 +- builtin/fetch-pack.c | 2 +- builtin/fmt-merge-msg.c | 2 +- builtin/for-each-ref.c | 2 +- builtin/fsck.c | 2 +- builtin/gc.c | 2 +- builtin/grep.c | 2 +- builtin/hash-object.c | 2 +- builtin/help.c | 2 +- builtin/init-db.c | 2 +- builtin/log.c | 6 +++--- builtin/ls-files.c | 2 +- builtin/ls-remote.c | 2 +- builtin/mailinfo.c | 2 +- builtin/merge-base.c | 4 ++-- builtin/merge-file.c | 4 ++-- builtin/merge-index.c | 2 +- builtin/merge.c | 4 ++-- builtin/mv.c | 2 +- builtin/name-rev.c | 6 +++--- builtin/notes.c | 24 ++++++++++++------------ builtin/pack-redundant.c | 2 +- builtin/pack-refs.c | 2 +- builtin/prune-packed.c | 2 +- builtin/remote.c | 4 ++-- builtin/repack.c | 2 +- builtin/rerere.c | 2 +- builtin/rev-parse.c | 6 +++--- builtin/revert.c | 4 ++-- builtin/rm.c | 2 +- builtin/shortlog.c | 2 +- builtin/show-branch.c | 4 ++-- builtin/show-ref.c | 2 +- builtin/symbolic-ref.c | 4 ++-- builtin/tag.c | 4 ++-- builtin/update-index.c | 2 +- builtin/update-ref.c | 6 +++--- builtin/verify-commit.c | 2 +- builtin/verify-pack.c | 2 +- builtin/verify-tag.c | 2 +- credential-store.c | 2 +- git-bisect.sh | 2 +- git.c | 2 +- 64 files changed, 109 insertions(+), 105 deletions(-) diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines index 894546dd75..ad3b2adb60 100644 --- a/Documentation/CodingGuidelines +++ b/Documentation/CodingGuidelines @@ -441,6 +441,10 @@ Writing Documentation: --sort= --abbrev[=] + If a placeholder has multiple words, they are separated by dashes: + + --template= + Possibility of multiple occurrences is indicated by three dots: ... (One or more of .) @@ -457,12 +461,12 @@ Writing Documentation: (Zero or more of . Note that the dots are inside, not outside the brackets.) - Multiple alternatives are indicated with vertical bar: + Multiple alternatives are indicated with vertical bars: [-q | --quiet] [--utf8 | --no-utf8] Parentheses are used for grouping: - [(|)...] + [( | )...] (Any number of either or . Parens are needed to make it clear that "..." pertains to both and .) diff --git a/advice.c b/advice.c index 3b8bf3c6da..575bec20b3 100644 --- a/advice.c +++ b/advice.c @@ -105,7 +105,7 @@ void detach_advice(const char *new_name) "state without impacting any branches by performing another checkout.\n\n" "If you want to create a new branch to retain commits you create, you may\n" "do so (now or later) by using -b with the checkout command again. Example:\n\n" - " git checkout -b new_branch_name\n\n"; + " git checkout -b \n\n"; fprintf(stderr, fmt, new_name); } diff --git a/archive.c b/archive.c index 9e30246b64..96057ed830 100644 --- a/archive.c +++ b/archive.c @@ -8,9 +8,9 @@ #include "dir.h" static char const * const archive_usage[] = { - N_("git archive [options] [...]"), + N_("git archive [] [...]"), N_("git archive --list"), - N_("git archive --remote [--exec ] [options] [...]"), + N_("git archive --remote [--exec ] [] [...]"), N_("git archive --remote [--exec ] --list"), NULL }; diff --git a/builtin/add.c b/builtin/add.c index 1074e32349..3390933d68 100644 --- a/builtin/add.c +++ b/builtin/add.c @@ -19,7 +19,7 @@ #include "argv-array.h" static const char * const builtin_add_usage[] = { - N_("git add [options] [--] ..."), + N_("git add [] [--] ..."), NULL }; static int patch_interactive, add_interactive, edit_interactive; diff --git a/builtin/apply.c b/builtin/apply.c index 0aad912839..7cd9a3b593 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -55,7 +55,7 @@ static const char *fake_ancestor; static int line_termination = '\n'; static unsigned int p_context = UINT_MAX; static const char * const apply_usage[] = { - N_("git apply [options] [...]"), + N_("git apply [] [...]"), NULL }; diff --git a/builtin/blame.c b/builtin/blame.c index 303e217ae9..f0fac655ed 100644 --- a/builtin/blame.c +++ b/builtin/blame.c @@ -27,12 +27,12 @@ #include "line-range.h" #include "line-log.h" -static char blame_usage[] = N_("git blame [options] [rev-opts] [rev] [--] file"); +static char blame_usage[] = N_("git blame [] [] [] [--] file"); static const char *blame_opt_usage[] = { blame_usage, "", - N_("[rev-opts] are documented in git-rev-list(1)"), + N_(" are documented in git-rev-list(1)"), NULL }; diff --git a/builtin/branch.c b/builtin/branch.c index dc6f0b266c..6a25957e9f 100644 --- a/builtin/branch.c +++ b/builtin/branch.c @@ -21,10 +21,10 @@ #include "wt-status.h" static const char * const builtin_branch_usage[] = { - N_("git branch [options] [-r | -a] [--merged | --no-merged]"), - N_("git branch [options] [-l] [-f] []"), - N_("git branch [options] [-r] (-d | -D) ..."), - N_("git branch [options] (-m | -M) [] "), + N_("git branch [] [-r | -a] [--merged | --no-merged]"), + N_("git branch [] [-l] [-f] []"), + N_("git branch [] [-r] (-d | -D) ..."), + N_("git branch [] (-m | -M) [] "), NULL }; diff --git a/builtin/cat-file.c b/builtin/cat-file.c index f8d81291b9..c2e4e53ce4 100644 --- a/builtin/cat-file.c +++ b/builtin/cat-file.c @@ -329,8 +329,8 @@ static int batch_objects(struct batch_options *opt) } static const char * const cat_file_usage[] = { - N_("git cat-file (-t|-s|-e|-p||--textconv) "), - N_("git cat-file (--batch|--batch-check) < "), + N_("git cat-file (-t | -s | -e | -p | | --textconv) "), + N_("git cat-file (--batch | --batch-check) < "), NULL }; diff --git a/builtin/check-attr.c b/builtin/check-attr.c index 5600ec3f61..21d2bedcc9 100644 --- a/builtin/check-attr.c +++ b/builtin/check-attr.c @@ -8,8 +8,8 @@ static int all_attrs; static int cached_attrs; static int stdin_paths; static const char * const check_attr_usage[] = { -N_("git check-attr [-a | --all | attr...] [--] pathname..."), -N_("git check-attr --stdin [-z] [-a | --all | attr...] < "), +N_("git check-attr [-a | --all | ...] [--] ..."), +N_("git check-attr --stdin [-z] [-a | --all | ...] < "), NULL }; diff --git a/builtin/check-ignore.c b/builtin/check-ignore.c index 594463a11b..dc8d97c56c 100644 --- a/builtin/check-ignore.c +++ b/builtin/check-ignore.c @@ -7,8 +7,8 @@ static int quiet, verbose, stdin_paths, show_non_matching, no_index; static const char * const check_ignore_usage[] = { -"git check-ignore [options] pathname...", -"git check-ignore [options] --stdin < ", +"git check-ignore [] ...", +"git check-ignore [] --stdin < ", NULL }; diff --git a/builtin/check-mailmap.c b/builtin/check-mailmap.c index 8f4d809bd8..eaaea546d3 100644 --- a/builtin/check-mailmap.c +++ b/builtin/check-mailmap.c @@ -5,7 +5,7 @@ static int use_stdin; static const char * const check_mailmap_usage[] = { -N_("git check-mailmap [options] ..."), +N_("git check-mailmap [] ..."), NULL }; diff --git a/builtin/check-ref-format.c b/builtin/check-ref-format.c index 28a7320271..fd915d5984 100644 --- a/builtin/check-ref-format.c +++ b/builtin/check-ref-format.c @@ -8,7 +8,7 @@ #include "strbuf.h" static const char builtin_check_ref_format_usage[] = -"git check-ref-format [--normalize] [options] \n" +"git check-ref-format [--normalize] [] \n" " or: git check-ref-format --branch "; /* diff --git a/builtin/checkout-index.c b/builtin/checkout-index.c index 031780f49e..9ca2da1583 100644 --- a/builtin/checkout-index.c +++ b/builtin/checkout-index.c @@ -123,7 +123,7 @@ static void checkout_all(const char *prefix, int prefix_length) } static const char * const builtin_checkout_index_usage[] = { - N_("git checkout-index [options] [--] [...]"), + N_("git checkout-index [] [--] [...]"), NULL }; diff --git a/builtin/checkout.c b/builtin/checkout.c index 52d6cbb0a8..3e141fc149 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -22,8 +22,8 @@ #include "argv-array.h" static const char * const checkout_usage[] = { - N_("git checkout [options] "), - N_("git checkout [options] [] -- ..."), + N_("git checkout [] "), + N_("git checkout [] [] -- ..."), NULL, }; @@ -746,7 +746,7 @@ static void suggest_reattach(struct commit *commit, struct rev_info *revs) _( "If you want to keep them by creating a new branch, " "this may be a good time\nto do so with:\n\n" - " git branch new_branch_name %s\n\n"), + " git branch %s\n\n"), find_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV)); } @@ -1127,7 +1127,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix) OPT_BOOL(0, "ignore-skip-worktree-bits", &opts.ignore_skipworktree, N_("do not limit pathspecs to sparse entries only")), OPT_HIDDEN_BOOL(0, "guess", &dwim_new_local_branch, - N_("second guess 'git checkout no-such-branch'")), + N_("second guess 'git checkout '")), OPT_END(), }; diff --git a/builtin/clone.c b/builtin/clone.c index 316c75d0b3..957246723e 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -34,7 +34,7 @@ * */ static const char * const builtin_clone_usage[] = { - N_("git clone [options] [--] []"), + N_("git clone [] [--] []"), NULL }; diff --git a/builtin/column.c b/builtin/column.c index 75818520e1..449413c8a8 100644 --- a/builtin/column.c +++ b/builtin/column.c @@ -6,7 +6,7 @@ #include "column.h" static const char * const builtin_column_usage[] = { - N_("git column [options]"), + N_("git column []"), NULL }; static unsigned int colopts; diff --git a/builtin/commit.c b/builtin/commit.c index 7d90c35915..6716e11b8d 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -34,12 +34,12 @@ #include "mailmap.h" static const char * const builtin_commit_usage[] = { - N_("git commit [options] [--] ..."), + N_("git commit [] [--] ..."), NULL }; static const char * const builtin_status_usage[] = { - N_("git status [options] [--] ..."), + N_("git status [] [--] ..."), NULL }; diff --git a/builtin/config.c b/builtin/config.c index 15a7bea936..d32c5327e5 100644 --- a/builtin/config.c +++ b/builtin/config.c @@ -5,7 +5,7 @@ #include "urlmatch.h" static const char *const builtin_config_usage[] = { - N_("git config [options]"), + N_("git config []"), NULL }; diff --git a/builtin/describe.c b/builtin/describe.c index 9103193b4f..e00a75b121 100644 --- a/builtin/describe.c +++ b/builtin/describe.c @@ -14,8 +14,8 @@ #define MAX_TAGS (FLAG_BITS - 1) static const char * const describe_usage[] = { - N_("git describe [options] *"), - N_("git describe [options] --dirty"), + N_("git describe [] [...]"), + N_("git describe [] --dirty"), NULL }; diff --git a/builtin/diff-files.c b/builtin/diff-files.c index 9200069363..8ed2eb8813 100644 --- a/builtin/diff-files.c +++ b/builtin/diff-files.c @@ -11,7 +11,7 @@ #include "submodule.h" static const char diff_files_usage[] = -"git diff-files [-q] [-0/-1/2/3 |-c|--cc] [] [...]" +"git diff-files [-q] [-0 | -1 | -2 | -3 | -c | --cc] [] [...]" COMMON_DIFF_OPTIONS_HELP; int cmd_diff_files(int argc, const char **argv, const char *prefix) diff --git a/builtin/diff-index.c b/builtin/diff-index.c index ce15b23042..d979824f93 100644 --- a/builtin/diff-index.c +++ b/builtin/diff-index.c @@ -7,7 +7,7 @@ static const char diff_cache_usage[] = "git diff-index [-m] [--cached] " -"[] [...]" +"[] [...]" COMMON_DIFF_OPTIONS_HELP; int cmd_diff_index(int argc, const char **argv, const char *prefix) diff --git a/builtin/diff-tree.c b/builtin/diff-tree.c index 1c4ad6223e..12b683d021 100644 --- a/builtin/diff-tree.c +++ b/builtin/diff-tree.c @@ -82,7 +82,7 @@ static int diff_tree_stdin(char *line) static const char diff_tree_usage[] = "git diff-tree [--stdin] [-m] [-c] [--cc] [-s] [-v] [--pretty] [-t] [-r] [--root] " -"[] [] [...]\n" +"[] [] [...]\n" " -r diff recursively\n" " --root include the initial commit as diff against /dev/null\n" COMMON_DIFF_OPTIONS_HELP; diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c index 1262b405f8..4a6b340ab6 100644 --- a/builtin/fetch-pack.c +++ b/builtin/fetch-pack.c @@ -6,7 +6,7 @@ #include "sha1-array.h" static const char fetch_pack_usage[] = -"git fetch-pack [--all] [--stdin] [--quiet|-q] [--keep|-k] [--thin] " +"git fetch-pack [--all] [--stdin] [--quiet | -q] [--keep | -k] [--thin] " "[--include-tag] [--upload-pack=] [--depth=] " "[--no-progress] [--diag-url] [-v] [:] [...]"; diff --git a/builtin/fmt-merge-msg.c b/builtin/fmt-merge-msg.c index af7919e51e..1d962dc569 100644 --- a/builtin/fmt-merge-msg.c +++ b/builtin/fmt-merge-msg.c @@ -10,7 +10,7 @@ #include "gpg-interface.h" static const char * const fmt_merge_msg_usage[] = { - N_("git fmt-merge-msg [-m ] [--log[=]|--no-log] [--file ]"), + N_("git fmt-merge-msg [-m ] [--log[=] | --no-log] [--file ]"), NULL }; diff --git a/builtin/for-each-ref.c b/builtin/for-each-ref.c index f3ce004d53..c97368a843 100644 --- a/builtin/for-each-ref.c +++ b/builtin/for-each-ref.c @@ -1054,7 +1054,7 @@ static int opt_parse_sort(const struct option *opt, const char *arg, int unset) } static char const * const for_each_ref_usage[] = { - N_("git for-each-ref [options] []"), + N_("git for-each-ref [] []"), NULL }; diff --git a/builtin/fsck.c b/builtin/fsck.c index a27515aeaa..0c757862e8 100644 --- a/builtin/fsck.c +++ b/builtin/fsck.c @@ -600,7 +600,7 @@ static int fsck_cache_tree(struct cache_tree *it) } static char const * const fsck_usage[] = { - N_("git fsck [options] [...]"), + N_("git fsck [] [...]"), NULL }; diff --git a/builtin/gc.c b/builtin/gc.c index 005adbebea..5c634afc00 100644 --- a/builtin/gc.c +++ b/builtin/gc.c @@ -21,7 +21,7 @@ #define FAILED_RUN "failed to run %s" static const char * const builtin_gc_usage[] = { - N_("git gc [options]"), + N_("git gc []"), NULL }; diff --git a/builtin/grep.c b/builtin/grep.c index 4063882f06..9262b73b6f 100644 --- a/builtin/grep.c +++ b/builtin/grep.c @@ -20,7 +20,7 @@ #include "pathspec.h" static char const * const grep_usage[] = { - N_("git grep [options] [-e] [...] [[--] ...]"), + N_("git grep [] [-e] [...] [[--] ...]"), NULL }; diff --git a/builtin/hash-object.c b/builtin/hash-object.c index 6158363318..207b90c7b1 100644 --- a/builtin/hash-object.c +++ b/builtin/hash-object.c @@ -79,7 +79,7 @@ static void hash_stdin_paths(const char *type, int no_filters, unsigned flags, int cmd_hash_object(int argc, const char **argv, const char *prefix) { static const char * const hash_object_usage[] = { - N_("git hash-object [-t ] [-w] [--path=|--no-filters] [--stdin] [--] ..."), + N_("git hash-object [-t ] [-w] [--path= | --no-filters] [--stdin] [--] ..."), N_("git hash-object --stdin-paths < "), NULL }; diff --git a/builtin/help.c b/builtin/help.c index e78c135e01..6133fe496b 100644 --- a/builtin/help.c +++ b/builtin/help.c @@ -49,7 +49,7 @@ static struct option builtin_help_options[] = { }; static const char * const builtin_help_usage[] = { - N_("git help [--all] [--guides] [--man|--web|--info] [command]"), + N_("git help [--all] [--guides] [--man | --web | --info] []"), NULL }; diff --git a/builtin/init-db.c b/builtin/init-db.c index 9966522b4a..6723d39c3b 100644 --- a/builtin/init-db.c +++ b/builtin/init-db.c @@ -472,7 +472,7 @@ static int shared_callback(const struct option *opt, const char *arg, int unset) } static const char *const init_db_usage[] = { - N_("git init [-q | --quiet] [--bare] [--template=] [--shared[=]] [directory]"), + N_("git init [-q | --quiet] [--bare] [--template=] [--shared[=]] []"), NULL }; diff --git a/builtin/log.c b/builtin/log.c index f2a9f0156d..d65d96a7a3 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -38,8 +38,8 @@ static const char *fmt_patch_subject_prefix = "PATCH"; static const char *fmt_pretty; static const char * const builtin_log_usage[] = { - N_("git log [] [] [[--] ...]\n") - N_(" or: git show [options] ..."), + N_("git log [] [] [[--] ...]\n") + N_(" or: git show [] ..."), NULL }; @@ -1023,7 +1023,7 @@ static const char *set_outdir(const char *prefix, const char *output_directory) } static const char * const builtin_format_patch_usage[] = { - N_("git format-patch [options] [ | ]"), + N_("git format-patch [] [ | ]"), NULL }; diff --git a/builtin/ls-files.c b/builtin/ls-files.c index 99cee20fb0..914054d367 100644 --- a/builtin/ls-files.c +++ b/builtin/ls-files.c @@ -398,7 +398,7 @@ int report_path_error(const char *ps_matched, } static const char * const ls_files_usage[] = { - N_("git ls-files [options] [...]"), + N_("git ls-files [] [...]"), NULL }; diff --git a/builtin/ls-remote.c b/builtin/ls-remote.c index b2a4b92992..4554dbc8a9 100644 --- a/builtin/ls-remote.c +++ b/builtin/ls-remote.c @@ -5,7 +5,7 @@ static const char ls_remote_usage[] = "git ls-remote [--heads] [--tags] [-u | --upload-pack ]\n" -" [-q|--quiet] [--exit-code] [--get-url] [ [...]]"; +" [-q | --quiet] [--exit-code] [--get-url] [ [...]]"; /* * Is there one among the list of patterns that match the tail part diff --git a/builtin/mailinfo.c b/builtin/mailinfo.c index c8a47c173d..999a5250fb 100644 --- a/builtin/mailinfo.c +++ b/builtin/mailinfo.c @@ -1031,7 +1031,7 @@ static int git_mailinfo_config(const char *var, const char *value, void *unused) } static const char mailinfo_usage[] = - "git mailinfo [-k|-b] [-m | --message-id] [-u | --encoding= | -n] [--scissors | --no-scissors] msg patch < mail >info"; + "git mailinfo [-k | -b] [-m | --message-id] [-u | --encoding= | -n] [--scissors | --no-scissors] < mail >info"; int cmd_mailinfo(int argc, const char **argv, const char *prefix) { diff --git a/builtin/merge-base.c b/builtin/merge-base.c index fdebef6fa1..08a8217890 100644 --- a/builtin/merge-base.c +++ b/builtin/merge-base.c @@ -26,8 +26,8 @@ static int show_merge_base(struct commit **rev, int rev_nr, int show_all) } static const char * const merge_base_usage[] = { - N_("git merge-base [-a|--all] ..."), - N_("git merge-base [-a|--all] --octopus ..."), + N_("git merge-base [-a | --all] ..."), + N_("git merge-base [-a | --all] --octopus ..."), N_("git merge-base --independent ..."), N_("git merge-base --is-ancestor "), N_("git merge-base --fork-point []"), diff --git a/builtin/merge-file.c b/builtin/merge-file.c index 844f84f40b..131edc245f 100644 --- a/builtin/merge-file.c +++ b/builtin/merge-file.c @@ -5,7 +5,7 @@ #include "parse-options.h" static const char *const merge_file_usage[] = { - N_("git merge-file [options] [-L name1 [-L orig [-L name2]]] file1 orig_file file2"), + N_("git merge-file [] [-L [-L [-L ]]] "), NULL }; @@ -42,7 +42,7 @@ int cmd_merge_file(int argc, const char **argv, const char *prefix) N_("for conflicts, use this marker size")), OPT__QUIET(&quiet, N_("do not warn about conflicts")), OPT_CALLBACK('L', NULL, names, N_("name"), - N_("set labels for file1/orig_file/file2"), &label_cb), + N_("set labels for file1/orig-file/file2"), &label_cb), OPT_END(), }; diff --git a/builtin/merge-index.c b/builtin/merge-index.c index b416d92849..1a1eafa6fd 100644 --- a/builtin/merge-index.c +++ b/builtin/merge-index.c @@ -75,7 +75,7 @@ int cmd_merge_index(int argc, const char **argv, const char *prefix) signal(SIGCHLD, SIG_DFL); if (argc < 3) - usage("git merge-index [-o] [-q] (-a | [--] *)"); + usage("git merge-index [-o] [-q] (-a | [--] [...])"); read_cache(); diff --git a/builtin/merge.c b/builtin/merge.c index c638fd5a9a..3b0f8f96d4 100644 --- a/builtin/merge.c +++ b/builtin/merge.c @@ -42,8 +42,8 @@ struct strategy { }; static const char * const builtin_merge_usage[] = { - N_("git merge [options] [...]"), - N_("git merge [options] HEAD "), + N_("git merge [] [...]"), + N_("git merge [] HEAD "), N_("git merge --abort"), NULL }; diff --git a/builtin/mv.c b/builtin/mv.c index 563d05ba1a..d1d43168ae 100644 --- a/builtin/mv.c +++ b/builtin/mv.c @@ -12,7 +12,7 @@ #include "submodule.h" static const char * const builtin_mv_usage[] = { - N_("git mv [options] ... "), + N_("git mv [] ... "), NULL }; diff --git a/builtin/name-rev.c b/builtin/name-rev.c index 3c8f319be6..9736d4452f 100644 --- a/builtin/name-rev.c +++ b/builtin/name-rev.c @@ -252,9 +252,9 @@ static void show_name(const struct object *obj, } static char const * const name_rev_usage[] = { - N_("git name-rev [options] ..."), - N_("git name-rev [options] --all"), - N_("git name-rev [options] --stdin"), + N_("git name-rev [] ..."), + N_("git name-rev [] --all"), + N_("git name-rev [] --stdin"), NULL }; diff --git a/builtin/notes.c b/builtin/notes.c index a9f37d0456..63f95fc554 100644 --- a/builtin/notes.c +++ b/builtin/notes.c @@ -21,18 +21,18 @@ #include "notes-utils.h" static const char * const git_notes_usage[] = { - N_("git notes [--ref ] [list []]"), - N_("git notes [--ref ] add [-f] [--allow-empty] [-m | -F | (-c | -C) ] []"), - N_("git notes [--ref ] copy [-f] "), - N_("git notes [--ref ] append [--allow-empty] [-m | -F | (-c | -C) ] []"), - N_("git notes [--ref ] edit [--allow-empty] []"), - N_("git notes [--ref ] show []"), - N_("git notes [--ref ] merge [-v | -q] [-s ] "), + N_("git notes [--ref ] [list []]"), + N_("git notes [--ref ] add [-f] [--allow-empty] [-m | -F | (-c | -C) ] []"), + N_("git notes [--ref ] copy [-f] "), + N_("git notes [--ref ] append [--allow-empty] [-m | -F | (-c | -C) ] []"), + N_("git notes [--ref ] edit [--allow-empty] []"), + N_("git notes [--ref ] show []"), + N_("git notes [--ref ] merge [-v | -q] [-s ] "), N_("git notes merge --commit [-v | -q]"), N_("git notes merge --abort [-v | -q]"), - N_("git notes [--ref ] remove [...]"), - N_("git notes [--ref ] prune [-n | -v]"), - N_("git notes [--ref ] get-ref"), + N_("git notes [--ref ] remove [...]"), + N_("git notes [--ref ] prune [-n | -v]"), + N_("git notes [--ref ] get-ref"), NULL }; @@ -68,7 +68,7 @@ static const char * const git_notes_show_usage[] = { }; static const char * const git_notes_merge_usage[] = { - N_("git notes merge [] "), + N_("git notes merge [] "), N_("git notes merge --commit []"), N_("git notes merge --abort []"), NULL @@ -951,7 +951,7 @@ int cmd_notes(int argc, const char **argv, const char *prefix) const char *override_notes_ref = NULL; struct option options[] = { OPT_STRING(0, "ref", &override_notes_ref, N_("notes-ref"), - N_("use notes from ")), + N_("use notes from ")), OPT_END() }; diff --git a/builtin/pack-redundant.c b/builtin/pack-redundant.c index 649c3aaa93..d0532f66b1 100644 --- a/builtin/pack-redundant.c +++ b/builtin/pack-redundant.c @@ -11,7 +11,7 @@ #define BLKSIZE 512 static const char pack_redundant_usage[] = -"git pack-redundant [ --verbose ] [ --alt-odb ] < --all | <.pack filename> ...>"; +"git pack-redundant [--verbose] [--alt-odb] (--all | ...)"; static int load_all_packs, verbose, alt_odb; diff --git a/builtin/pack-refs.c b/builtin/pack-refs.c index b20b1ec4c1..39f9a55d16 100644 --- a/builtin/pack-refs.c +++ b/builtin/pack-refs.c @@ -3,7 +3,7 @@ #include "refs.h" static char const * const pack_refs_usage[] = { - N_("git pack-refs [options]"), + N_("git pack-refs []"), NULL }; diff --git a/builtin/prune-packed.c b/builtin/prune-packed.c index f24a2c2bdc..7cf900ea07 100644 --- a/builtin/prune-packed.c +++ b/builtin/prune-packed.c @@ -4,7 +4,7 @@ #include "parse-options.h" static const char * const prune_packed_usage[] = { - N_("git prune-packed [-n|--dry-run] [-q|--quiet]"), + N_("git prune-packed [-n | --dry-run] [-q | --quiet]"), NULL }; diff --git a/builtin/remote.c b/builtin/remote.c index 46ecfd9f7b..33ff7e06e7 100644 --- a/builtin/remote.c +++ b/builtin/remote.c @@ -10,10 +10,10 @@ static const char * const builtin_remote_usage[] = { N_("git remote [-v | --verbose]"), - N_("git remote add [-t ] [-m ] [-f] [--tags|--no-tags] [--mirror=] "), + N_("git remote add [-t ] [-m ] [-f] [--tags | --no-tags] [--mirror=] "), N_("git remote rename "), N_("git remote remove "), - N_("git remote set-head (-a | --auto | -d | --delete |)"), + N_("git remote set-head (-a | --auto | -d | --delete | )"), N_("git remote [-v | --verbose] show [-n] "), N_("git remote prune [-n | --dry-run] "), N_("git remote [-v | --verbose] update [-p | --prune] [( | )...]"), diff --git a/builtin/repack.c b/builtin/repack.c index 3f852f35d1..28fbc7099a 100644 --- a/builtin/repack.c +++ b/builtin/repack.c @@ -14,7 +14,7 @@ static int write_bitmaps; static char *packdir, *packtmp; static const char *const git_repack_usage[] = { - N_("git repack [options]"), + N_("git repack []"), NULL }; diff --git a/builtin/rerere.c b/builtin/rerere.c index 98eb8c5404..7afadd2ead 100644 --- a/builtin/rerere.c +++ b/builtin/rerere.c @@ -9,7 +9,7 @@ #include "pathspec.h" static const char * const rerere_usage[] = { - N_("git rerere [clear | forget path... | status | remaining | diff | gc]"), + N_("git rerere [clear | forget ... | status | remaining | diff | gc]"), NULL, }; diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c index 95328b80d9..3626c61da6 100644 --- a/builtin/rev-parse.c +++ b/builtin/rev-parse.c @@ -358,7 +358,7 @@ static int cmd_parseopt(int argc, const char **argv, const char *prefix) { static int keep_dashdash = 0, stop_at_non_option = 0; static char const * const parseopt_usage[] = { - N_("git rev-parse --parseopt [options] -- [...]"), + N_("git rev-parse --parseopt [] -- [...]"), NULL }; static struct option parseopt_opts[] = { @@ -496,9 +496,9 @@ static void die_no_single_rev(int quiet) } static const char builtin_rev_parse_usage[] = -N_("git rev-parse --parseopt [options] -- [...]\n" +N_("git rev-parse --parseopt [] -- [...]\n" " or: git rev-parse --sq-quote [...]\n" - " or: git rev-parse [options] [...]\n" + " or: git rev-parse [] [...]\n" "\n" "Run \"git rev-parse --parseopt -h\" for more information on the first usage."); diff --git a/builtin/revert.c b/builtin/revert.c index f9ed5bd5d0..56a2c36669 100644 --- a/builtin/revert.c +++ b/builtin/revert.c @@ -19,13 +19,13 @@ */ static const char * const revert_usage[] = { - N_("git revert [options] ..."), + N_("git revert [] ..."), N_("git revert "), NULL }; static const char * const cherry_pick_usage[] = { - N_("git cherry-pick [options] ..."), + N_("git cherry-pick [] ..."), N_("git cherry-pick "), NULL }; diff --git a/builtin/rm.c b/builtin/rm.c index d8a9c86dd1..3304bff42a 100644 --- a/builtin/rm.c +++ b/builtin/rm.c @@ -14,7 +14,7 @@ #include "pathspec.h" static const char * const builtin_rm_usage[] = { - N_("git rm [options] [--] ..."), + N_("git rm [] [--] ..."), NULL }; diff --git a/builtin/shortlog.c b/builtin/shortlog.c index 4b7e53623f..c0bab6aaa9 100644 --- a/builtin/shortlog.c +++ b/builtin/shortlog.c @@ -10,7 +10,7 @@ #include "parse-options.h" static char const * const shortlog_usage[] = { - N_("git shortlog [] [] [[--] [...]]"), + N_("git shortlog [] [] [[--] [...]]"), NULL }; diff --git a/builtin/show-branch.c b/builtin/show-branch.c index 270e39c6c1..e9b37dc479 100644 --- a/builtin/show-branch.c +++ b/builtin/show-branch.c @@ -6,8 +6,8 @@ #include "parse-options.h" static const char* show_branch_usage[] = { - N_("git show-branch [-a|--all] [-r|--remotes] [--topo-order | --date-order] [--current] [--color[=] | --no-color] [--sparse] [--more= | --list | --independent | --merge-base] [--no-name | --sha1-name] [--topics] [( | )...]"), - N_("git show-branch (-g|--reflog)[=[,]] [--list] []"), + N_("git show-branch [-a | --all] [-r | --remotes] [--topo-order | --date-order] [--current] [--color[=] | --no-color] [--sparse] [--more= | --list | --independent | --merge-base] [--no-name | --sha1-name] [--topics] [( | )...]"), + N_("git show-branch (-g | --reflog)[=[,]] [--list] []"), NULL }; diff --git a/builtin/show-ref.c b/builtin/show-ref.c index 5ba1f30838..afb10309d6 100644 --- a/builtin/show-ref.c +++ b/builtin/show-ref.c @@ -7,7 +7,7 @@ #include "parse-options.h" static const char * const show_ref_usage[] = { - N_("git show-ref [-q|--quiet] [--verify] [--head] [-d|--dereference] [-s|--hash[=]] [--abbrev[=]] [--tags] [--heads] [--] [pattern*] "), + N_("git show-ref [-q | --quiet] [--verify] [--head] [-d | --dereference] [-s | --hash[=]] [--abbrev[=]] [--tags] [--heads] [--] [...]"), N_("git show-ref --exclude-existing[=pattern] < ref-list"), NULL }; diff --git a/builtin/symbolic-ref.c b/builtin/symbolic-ref.c index 29fb3f1c20..ce0fde705c 100644 --- a/builtin/symbolic-ref.c +++ b/builtin/symbolic-ref.c @@ -4,8 +4,8 @@ #include "parse-options.h" static const char * const git_symbolic_ref_usage[] = { - N_("git symbolic-ref [options] name [ref]"), - N_("git symbolic-ref -d [-q] name"), + N_("git symbolic-ref [] []"), + N_("git symbolic-ref -d [-q] "), NULL }; diff --git a/builtin/tag.c b/builtin/tag.c index e633f4efdb..6dc85a9d5e 100644 --- a/builtin/tag.c +++ b/builtin/tag.c @@ -19,9 +19,9 @@ #include "column.h" static const char * const git_tag_usage[] = { - N_("git tag [-a|-s|-u ] [-f] [-m |-F ] []"), + N_("git tag [-a | -s | -u ] [-f] [-m | -F ] []"), N_("git tag -d ..."), - N_("git tag -l [-n[]] [--contains ] [--points-at ] " + N_("git tag -l [-n[]] [--contains ] [--points-at ]" "\n\t\t[...]"), N_("git tag -v ..."), NULL diff --git a/builtin/update-index.c b/builtin/update-index.c index b0e3dc9105..587898624c 100644 --- a/builtin/update-index.c +++ b/builtin/update-index.c @@ -400,7 +400,7 @@ static void read_index_info(int line_termination) } static const char * const update_index_usage[] = { - N_("git update-index [options] [--] [...]"), + N_("git update-index [] [--] [...]"), NULL }; diff --git a/builtin/update-ref.c b/builtin/update-ref.c index 1993529521..2497ba4303 100644 --- a/builtin/update-ref.c +++ b/builtin/update-ref.c @@ -6,9 +6,9 @@ #include "argv-array.h" static const char * const git_update_ref_usage[] = { - N_("git update-ref [options] -d []"), - N_("git update-ref [options] []"), - N_("git update-ref [options] --stdin [-z]"), + N_("git update-ref [] -d []"), + N_("git update-ref [] []"), + N_("git update-ref [] --stdin [-z]"), NULL }; diff --git a/builtin/verify-commit.c b/builtin/verify-commit.c index b0f85042b2..ec0c4e3d83 100644 --- a/builtin/verify-commit.c +++ b/builtin/verify-commit.c @@ -14,7 +14,7 @@ #include "gpg-interface.h" static const char * const verify_commit_usage[] = { - N_("git verify-commit [-v|--verbose] ..."), + N_("git verify-commit [-v | --verbose] ..."), NULL }; diff --git a/builtin/verify-pack.c b/builtin/verify-pack.c index 7747537beb..c94e156932 100644 --- a/builtin/verify-pack.c +++ b/builtin/verify-pack.c @@ -51,7 +51,7 @@ static int verify_one_pack(const char *path, unsigned int flags) } static const char * const verify_pack_usage[] = { - N_("git verify-pack [-v|--verbose] [-s|--stat-only] ..."), + N_("git verify-pack [-v | --verbose] [-s | --stat-only] ..."), NULL }; diff --git a/builtin/verify-tag.c b/builtin/verify-tag.c index 9cdf332333..53c68fce3a 100644 --- a/builtin/verify-tag.c +++ b/builtin/verify-tag.c @@ -14,7 +14,7 @@ #include "gpg-interface.h" static const char * const verify_tag_usage[] = { - N_("git verify-tag [-v|--verbose] ..."), + N_("git verify-tag [-v | --verbose] ..."), NULL }; diff --git a/credential-store.c b/credential-store.c index d435514cbe..925d3f4024 100644 --- a/credential-store.c +++ b/credential-store.c @@ -118,7 +118,7 @@ static int lookup_credential(const char *fn, struct credential *c) int main(int argc, char **argv) { const char * const usage[] = { - "git credential-store [options] ", + "git credential-store [] ", NULL }; const char *op; diff --git a/git-bisect.sh b/git-bisect.sh index 2fc07acb0f..ae3fec22c4 100755 --- a/git-bisect.sh +++ b/git-bisect.sh @@ -127,7 +127,7 @@ bisect_start() { if test "z$mode" != "z--no-checkout" then git checkout "$start_head" -- || - die "$(eval_gettext "Checking out '\$start_head' failed. Try 'git bisect reset '.")" + die "$(eval_gettext "Checking out '\$start_head' failed. Try 'git bisect reset '.")" fi else # Get rev from where we start. diff --git a/git.c b/git.c index 82d7a1cfee..0c029ecc4f 100644 --- a/git.c +++ b/git.c @@ -9,7 +9,7 @@ const char git_usage_string[] = "git [--version] [--help] [-C ] [-c name=value]\n" " [--exec-path[=]] [--html-path] [--man-path] [--info-path]\n" - " [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]\n" + " [-p | --paginate | --no-pager] [--no-replace-objects] [--bare]\n" " [--git-dir=] [--work-tree=] [--namespace=]\n" " []";