Skip to content

Commit 9c9b4f2

Browse files
alexhenriegitster
authored andcommitted
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 <foobar>* with [<foobar>...] Signed-off-by: Alex Henrie <[email protected]> Reviewed-by: Matthieu Moy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent addfb21 commit 9c9b4f2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+109
-105
lines changed

Documentation/CodingGuidelines

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,10 @@ Writing Documentation:
441441
--sort=<key>
442442
--abbrev[=<n>]
443443

444+
If a placeholder has multiple words, they are separated by dashes:
445+
<new-branch-name>
446+
--template=<template-directory>
447+
444448
Possibility of multiple occurrences is indicated by three dots:
445449
<file>...
446450
(One or more of <file>.)
@@ -457,12 +461,12 @@ Writing Documentation:
457461
(Zero or more of <patch>. Note that the dots are inside, not
458462
outside the brackets.)
459463

460-
Multiple alternatives are indicated with vertical bar:
464+
Multiple alternatives are indicated with vertical bars:
461465
[-q | --quiet]
462466
[--utf8 | --no-utf8]
463467

464468
Parentheses are used for grouping:
465-
[(<rev>|<range>)...]
469+
[(<rev> | <range>)...]
466470
(Any number of either <rev> or <range>. Parens are needed to make
467471
it clear that "..." pertains to both <rev> and <range>.)
468472

advice.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ void detach_advice(const char *new_name)
105105
"state without impacting any branches by performing another checkout.\n\n"
106106
"If you want to create a new branch to retain commits you create, you may\n"
107107
"do so (now or later) by using -b with the checkout command again. Example:\n\n"
108-
" git checkout -b new_branch_name\n\n";
108+
" git checkout -b <new-branch-name>\n\n";
109109

110110
fprintf(stderr, fmt, new_name);
111111
}

archive.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
#include "dir.h"
99

1010
static char const * const archive_usage[] = {
11-
N_("git archive [options] <tree-ish> [<path>...]"),
11+
N_("git archive [<options>] <tree-ish> [<path>...]"),
1212
N_("git archive --list"),
13-
N_("git archive --remote <repo> [--exec <cmd>] [options] <tree-ish> [<path>...]"),
13+
N_("git archive --remote <repo> [--exec <cmd>] [<options>] <tree-ish> [<path>...]"),
1414
N_("git archive --remote <repo> [--exec <cmd>] --list"),
1515
NULL
1616
};

builtin/add.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include "argv-array.h"
2020

2121
static const char * const builtin_add_usage[] = {
22-
N_("git add [options] [--] <pathspec>..."),
22+
N_("git add [<options>] [--] <pathspec>..."),
2323
NULL
2424
};
2525
static int patch_interactive, add_interactive, edit_interactive;

builtin/apply.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static const char *fake_ancestor;
5555
static int line_termination = '\n';
5656
static unsigned int p_context = UINT_MAX;
5757
static const char * const apply_usage[] = {
58-
N_("git apply [options] [<patch>...]"),
58+
N_("git apply [<options>] [<patch>...]"),
5959
NULL
6060
};
6161

builtin/blame.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@
2727
#include "line-range.h"
2828
#include "line-log.h"
2929

30-
static char blame_usage[] = N_("git blame [options] [rev-opts] [rev] [--] file");
30+
static char blame_usage[] = N_("git blame [<options>] [<rev-opts>] [<rev>] [--] file");
3131

3232
static const char *blame_opt_usage[] = {
3333
blame_usage,
3434
"",
35-
N_("[rev-opts] are documented in git-rev-list(1)"),
35+
N_("<rev-opts> are documented in git-rev-list(1)"),
3636
NULL
3737
};
3838

builtin/branch.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
#include "wt-status.h"
2222

2323
static const char * const builtin_branch_usage[] = {
24-
N_("git branch [options] [-r | -a] [--merged | --no-merged]"),
25-
N_("git branch [options] [-l] [-f] <branchname> [<start-point>]"),
26-
N_("git branch [options] [-r] (-d | -D) <branchname>..."),
27-
N_("git branch [options] (-m | -M) [<oldbranch>] <newbranch>"),
24+
N_("git branch [<options>] [-r | -a] [--merged | --no-merged]"),
25+
N_("git branch [<options>] [-l] [-f] <branch-name> [<start-point>]"),
26+
N_("git branch [<options>] [-r] (-d | -D) <branch-name>..."),
27+
N_("git branch [<options>] (-m | -M) [<old-branch>] <new-branch>"),
2828
NULL
2929
};
3030

builtin/cat-file.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,8 @@ static int batch_objects(struct batch_options *opt)
329329
}
330330

331331
static const char * const cat_file_usage[] = {
332-
N_("git cat-file (-t|-s|-e|-p|<type>|--textconv) <object>"),
333-
N_("git cat-file (--batch|--batch-check) < <list_of_objects>"),
332+
N_("git cat-file (-t | -s | -e | -p | <type> | --textconv) <object>"),
333+
N_("git cat-file (--batch | --batch-check) < <list-of-objects>"),
334334
NULL
335335
};
336336

builtin/check-attr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ static int all_attrs;
88
static int cached_attrs;
99
static int stdin_paths;
1010
static const char * const check_attr_usage[] = {
11-
N_("git check-attr [-a | --all | attr...] [--] pathname..."),
12-
N_("git check-attr --stdin [-z] [-a | --all | attr...] < <list-of-paths>"),
11+
N_("git check-attr [-a | --all | <attr>...] [--] <pathname>..."),
12+
N_("git check-attr --stdin [-z] [-a | --all | <attr>...] < <list-of-paths>"),
1313
NULL
1414
};
1515

builtin/check-ignore.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
static int quiet, verbose, stdin_paths, show_non_matching, no_index;
99
static const char * const check_ignore_usage[] = {
10-
"git check-ignore [options] pathname...",
11-
"git check-ignore [options] --stdin < <list-of-paths>",
10+
"git check-ignore [<options>] <pathname>...",
11+
"git check-ignore [<options>] --stdin < <list-of-paths>",
1212
NULL
1313
};
1414

0 commit comments

Comments
 (0)