Skip to content

Commit bb831db

Browse files
committed
Merge branch 'ah/usage-strings'
* ah/usage-strings: standardize usage info string format
2 parents afa3ccb + 9c9b4f2 commit bb831db

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

+108
-104
lines changed

Documentation/CodingGuidelines

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,10 @@ Writing Documentation:
446446
--sort=<key>
447447
--abbrev[=<n>]
448448

449+
If a placeholder has multiple words, they are separated by dashes:
450+
<new-branch-name>
451+
--template=<template-directory>
452+
449453
Possibility of multiple occurrences is indicated by three dots:
450454
<file>...
451455
(One or more of <file>.)
@@ -462,12 +466,12 @@ Writing Documentation:
462466
(Zero or more of <patch>. Note that the dots are inside, not
463467
outside the brackets.)
464468

465-
Multiple alternatives are indicated with vertical bar:
469+
Multiple alternatives are indicated with vertical bars:
466470
[-q | --quiet]
467471
[--utf8 | --no-utf8]
468472

469473
Parentheses are used for grouping:
470-
[(<rev>|<range>)...]
474+
[(<rev> | <range>)...]
471475
(Any number of either <rev> or <range>. Parens are needed to make
472476
it clear that "..." pertains to both <rev> and <range>.)
473477

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
@@ -323,8 +323,8 @@ static int batch_objects(struct batch_options *opt)
323323
}
324324

325325
static const char * const cat_file_usage[] = {
326-
N_("git cat-file (-t|-s|-e|-p|<type>|--textconv) <object>"),
327-
N_("git cat-file (--batch|--batch-check) < <list_of_objects>"),
326+
N_("git cat-file (-t | -s | -e | -p | <type> | --textconv) <object>"),
327+
N_("git cat-file (--batch | --batch-check) < <list-of-objects>"),
328328
NULL
329329
};
330330

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)