Skip to content

Commit 2632344

Browse files
committed
dvc: cmd arg names (metavars) to match docs
for #3626
1 parent 8e04fd9 commit 2632344

File tree

10 files changed

+84
-21
lines changed

10 files changed

+84
-21
lines changed

dvc/command/data_sync.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,11 @@ def shared_parent_parser():
8989
add_help=False, parents=[get_parent_parser()]
9090
)
9191
shared_parent_parser.add_argument(
92-
"-j", "--jobs", type=int, help="Number of jobs to run simultaneously."
92+
"-j",
93+
"--jobs",
94+
type=int,
95+
help="Number of jobs to run simultaneously.",
96+
metavar="<number>",
9397
)
9498
shared_parent_parser.add_argument(
9599
"targets",
@@ -115,7 +119,7 @@ def add_parser(subparsers, _parent_parser):
115119
formatter_class=argparse.RawDescriptionHelpFormatter,
116120
)
117121
pull_parser.add_argument(
118-
"-r", "--remote", help="Remote repository to pull from."
122+
"-r", "--remote", help="Remote storage to pull from", metavar="<name>",
119123
)
120124
pull_parser.add_argument(
121125
"-a",
@@ -171,7 +175,7 @@ def add_parser(subparsers, _parent_parser):
171175
formatter_class=argparse.RawDescriptionHelpFormatter,
172176
)
173177
push_parser.add_argument(
174-
"-r", "--remote", help="Remote repository to push to."
178+
"-r", "--remote", help="Remote storage to push to", metavar="<name>",
175179
)
176180
push_parser.add_argument(
177181
"-a",
@@ -223,7 +227,10 @@ def add_parser(subparsers, _parent_parser):
223227
formatter_class=argparse.RawDescriptionHelpFormatter,
224228
)
225229
fetch_parser.add_argument(
226-
"-r", "--remote", help="Remote repository to fetch from."
230+
"-r",
231+
"--remote",
232+
help="Remote storage to fetch from",
233+
metavar="<name>",
227234
)
228235
fetch_parser.add_argument(
229236
"-a",
@@ -292,7 +299,10 @@ def add_parser(subparsers, _parent_parser):
292299
help="Show status of a local cache compared to a remote repository.",
293300
)
294301
status_parser.add_argument(
295-
"-r", "--remote", help="Remote repository to compare local cache to."
302+
"-r",
303+
"--remote",
304+
help="Remote storage to compare local cache to",
305+
metavar="<name>",
296306
)
297307
status_parser.add_argument(
298308
"-a",

dvc/command/gc.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,10 @@ def add_parser(subparsers, parent_parser):
109109
help="Collect garbage in remote repository.",
110110
)
111111
gc_parser.add_argument(
112-
"-r", "--remote", help="Remote storage to collect garbage in."
112+
"-r",
113+
"--remote",
114+
help="Remote storage to collect garbage in",
115+
metavar="<name>",
113116
)
114117
gc_parser.add_argument(
115118
"-f",
@@ -119,7 +122,11 @@ def add_parser(subparsers, parent_parser):
119122
help="Force garbage collection - automatically agree to all prompts.",
120123
)
121124
gc_parser.add_argument(
122-
"-j", "--jobs", type=int, help="Number of jobs to run simultaneously."
125+
"-j",
126+
"--jobs",
127+
type=int,
128+
help="Number of jobs to run simultaneously.",
129+
metavar="<number>",
123130
)
124131
gc_parser.add_argument(
125132
"-p",
@@ -130,5 +137,6 @@ def add_parser(subparsers, parent_parser):
130137
help="Keep data files required by these projects "
131138
"in addition to the current one. "
132139
"Useful if you share a single cache across repos.",
140+
metavar="<paths>",
133141
)
134142
gc_parser.set_defaults(func=CmdGC)

dvc/command/get.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,17 @@ def add_parser(subparsers, parent_parser):
6666
"path", help="Path to a file or directory within the repository"
6767
)
6868
get_parser.add_argument(
69-
"-o", "--out", nargs="?", help="Destination path to download files to"
69+
"-o",
70+
"--out",
71+
nargs="?",
72+
help="Destination path to download files to",
73+
metavar="<path>",
7074
)
7175
get_parser.add_argument(
72-
"--rev", nargs="?", help="Git revision (e.g. SHA, branch, tag)"
76+
"--rev",
77+
nargs="?",
78+
help="Git revision (e.g. SHA, branch, tag)",
79+
metavar="<commit>",
7380
)
7481
get_parser.add_argument(
7582
"--show-url",

dvc/command/imp.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,16 @@ def add_parser(subparsers, parent_parser):
4848
"path", help="Path to a file or directory within the repository"
4949
)
5050
import_parser.add_argument(
51-
"-o", "--out", nargs="?", help="Destination path to download files to"
51+
"-o",
52+
"--out",
53+
nargs="?",
54+
help="Destination path to download files to",
55+
metavar="<path>",
5256
)
5357
import_parser.add_argument(
54-
"--rev", nargs="?", help="Git revision (e.g. SHA, branch, tag)"
58+
"--rev",
59+
nargs="?",
60+
help="Git revision (e.g. SHA, branch, tag)",
61+
metavar="<commit>",
5562
)
5663
import_parser.set_defaults(func=CmdImport)

dvc/command/imp_url.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ def add_parser(subparsers, parent_parser):
5959
"out", nargs="?", help="Destination path to put files to."
6060
)
6161
import_parser.add_argument(
62-
"-f", "--file", help="Specify name of the DVC-file it generates."
62+
"-f",
63+
"--file",
64+
help="Specify name of the DVC-file this command will generate.",
65+
metavar="<filename>",
6366
)
6467
import_parser.set_defaults(func=CmdImportUrl)

dvc/command/ls/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,10 @@ def add_parser(subparsers, parent_parser):
6767
"--outs-only", action="store_true", help="Show only DVC outputs."
6868
)
6969
list_parser.add_argument(
70-
"--rev", nargs="?", help="Git revision (e.g. branch, tag, SHA)"
70+
"--rev",
71+
nargs="?",
72+
help="Git revision (e.g. SHA, branch, tag)",
73+
metavar="<commit>",
7174
)
7275
list_parser.add_argument(
7376
"path",

dvc/command/metrics.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,10 @@ def add_parser(subparsers, parent_parser):
198198
"It can be detected by the file extension automatically. "
199199
"Unsupported types will be treated as raw."
200200
),
201+
metavar="<type>",
201202
)
202203
metrics_show_parser.add_argument(
203-
"-x", "--xpath", help="json/tsv/htsv/csv/hcsv path."
204+
"-x", "--xpath", help="json/tsv/htsv/csv/hcsv path.", metavar="<path>",
204205
)
205206
metrics_show_parser.add_argument(
206207
"-a",
@@ -243,10 +244,13 @@ def add_parser(subparsers, parent_parser):
243244
formatter_class=argparse.RawDescriptionHelpFormatter,
244245
)
245246
metrics_add_parser.add_argument(
246-
"-t", "--type", help="Type of metrics (raw/json/tsv/htsv/csv/hcsv)."
247+
"-t",
248+
"--type",
249+
help="Type of metrics (raw/json/tsv/htsv/csv/hcsv).",
250+
metavar="<type>",
247251
)
248252
metrics_add_parser.add_argument(
249-
"-x", "--xpath", help="json/tsv/htsv/csv/hcsv path."
253+
"-x", "--xpath", help="json/tsv/htsv/csv/hcsv path.", metavar="<path>",
250254
)
251255
metrics_add_parser.add_argument("path", help="Path to a metric file.")
252256
metrics_add_parser.set_defaults(func=CmdMetricsAdd)
@@ -260,10 +264,13 @@ def add_parser(subparsers, parent_parser):
260264
formatter_class=argparse.RawDescriptionHelpFormatter,
261265
)
262266
metrics_modify_parser.add_argument(
263-
"-t", "--type", help="Type of metrics (raw/json/tsv/htsv/csv/hcsv)."
267+
"-t",
268+
"--type",
269+
help="Type of metrics (raw/json/tsv/htsv/csv/hcsv).",
270+
metavar="<type>",
264271
)
265272
metrics_modify_parser.add_argument(
266-
"-x", "--xpath", help="json/tsv/htsv/csv/hcsv path."
273+
"-x", "--xpath", help="json/tsv/htsv/csv/hcsv path.", metavar="<path>",
267274
)
268275
metrics_modify_parser.add_argument("path", help="Path to a metric file.")
269276
metrics_modify_parser.set_defaults(func=CmdMetricsModify)
@@ -303,6 +310,7 @@ def add_parser(subparsers, parent_parser):
303310
"Metric files or directories (see -R) to show diff for. "
304311
"Shows diff for all metric files by default."
305312
),
313+
metavar="<paths>",
306314
)
307315
metrics_diff_parser.add_argument(
308316
"-t",
@@ -312,9 +320,10 @@ def add_parser(subparsers, parent_parser):
312320
"It can be detected by the file extension automatically. "
313321
"Unsupported types will be treated as raw."
314322
),
323+
metavar="<type>",
315324
)
316325
metrics_diff_parser.add_argument(
317-
"-x", "--xpath", help="json/tsv/htsv/csv/hcsv path."
326+
"-x", "--xpath", help="json/tsv/htsv/csv/hcsv path.", metavar="<path>",
318327
)
319328
metrics_diff_parser.add_argument(
320329
"-R",

dvc/command/repro.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ def add_parser(subparsers, parent_parser):
9292
"--cwd",
9393
default=os.path.curdir,
9494
help="Directory within your repo to reproduce from.",
95+
metavar="<path>",
9596
)
9697
repro_parser.add_argument(
9798
"-m",

dvc/command/run.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,15 @@ def add_parser(subparsers, parent_parser):
9595
action="append",
9696
default=[],
9797
help="Declare dependencies for reproducible cmd.",
98+
metavar="<path>",
9899
)
99100
run_parser.add_argument(
100101
"-o",
101102
"--outs",
102103
action="append",
103104
default=[],
104105
help="Declare output file or directory.",
106+
metavar="<filename>",
105107
)
106108
run_parser.add_argument(
107109
"-O",
@@ -110,20 +112,23 @@ def add_parser(subparsers, parent_parser):
110112
default=[],
111113
help="Declare output file or directory "
112114
"(do not put into DVC cache).",
115+
metavar="<filename>",
113116
)
114117
run_parser.add_argument(
115118
"-p",
116119
"--params",
117120
action="append",
118121
default=[],
119122
help="Declare parameter to use as additional dependency.",
123+
metavar="[<filename>:]<params_list>",
120124
)
121125
run_parser.add_argument(
122126
"-m",
123127
"--metrics",
124128
action="append",
125129
default=[],
126130
help="Declare output metric file or directory.",
131+
metavar="<path>",
127132
)
128133
run_parser.add_argument(
129134
"-M",
@@ -132,14 +137,19 @@ def add_parser(subparsers, parent_parser):
132137
default=[],
133138
help="Declare output metric file or directory "
134139
"(do not put into DVC cache).",
140+
metavar="<path>",
135141
)
136142
run_parser.add_argument(
137-
"-f", "--file", help="Specify name of the DVC-file it generates."
143+
"-f",
144+
"--file",
145+
help="Specify name of the DVC-file this command will generate.",
146+
metavar="<filename>",
138147
)
139148
run_parser.add_argument(
140149
"-w",
141150
"--wdir",
142151
help="Directory within your repo to run your command in.",
152+
metavar="<path>",
143153
)
144154
run_parser.add_argument(
145155
"--no-exec",
@@ -179,13 +189,15 @@ def add_parser(subparsers, parent_parser):
179189
default=[],
180190
help="Declare output file or directory that will not be "
181191
"removed upon repro.",
192+
metavar="<filename>",
182193
)
183194
run_parser.add_argument(
184195
"--outs-persist-no-cache",
185196
action="append",
186197
default=[],
187198
help="Declare output file or directory that will not be "
188199
"removed upon repro (do not put into DVC cache).",
200+
metavar="<filename>",
189201
)
190202
run_parser.add_argument(
191203
"--always-changed",

dvc/command/update.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ def add_parser(subparsers, parent_parser):
3434
"targets", nargs="+", help="DVC-files to update."
3535
)
3636
update_parser.add_argument(
37-
"--rev", nargs="?", help="Git revision (e.g. SHA, branch, tag)"
37+
"--rev",
38+
nargs="?",
39+
help="Git revision (e.g. SHA, branch, tag)",
40+
metavar="<commit>",
3841
)
3942
update_parser.set_defaults(func=CmdUpdate)

0 commit comments

Comments
 (0)