completion: misc fixes (#4076)

* command: add metavars

- makes help output look the same as before #3921

* deps: update shtab version

Part of #4070
This commit is contained in:
Casper da Costa-Luis
2020-06-22 02:09:43 +03:00
committed by GitHub
parent 9f6f599101
commit 061513a2ae
20 changed files with 29 additions and 3 deletions
+1
View File
@@ -66,6 +66,7 @@ def add_parser(subparsers, parent_parser):
"targets",
nargs="+",
help="Input files/directories to add.",
metavar="targets",
choices=completion.Required.FILE,
)
parser.set_defaults(func=CmdAdd)
+1
View File
@@ -56,6 +56,7 @@ def add_parser(subparsers, parent_parser):
help="Path to cache directory. Relative paths are resolved relative "
"to the current directory and saved to config relative to the "
"config file location.",
metavar="value",
choices=completion.Required.DIR,
)
cache_dir_parser.set_defaults(func=CmdCacheDir)
+1
View File
@@ -114,6 +114,7 @@ def add_parser(subparsers, parent_parser):
nargs="*",
help="DVC-files to checkout. Optional. "
"(Finds all DVC-files in the workspace by default.)",
metavar="targets",
choices=completion.Optional.DVC_FILE,
)
checkout_parser.set_defaults(func=CmdCheckout)
+1
View File
@@ -67,6 +67,7 @@ def add_parser(subparsers, parent_parser):
nargs="*",
help="DVC-files to commit. Optional. "
"(Finds all DVC-files in the workspace by default.)",
metavar="targets",
choices=completion.Optional.DVC_FILE,
)
commit_parser.set_defaults(func=CmdCommit)
+4 -1
View File
@@ -66,6 +66,9 @@ def add_parser(subparsers, parent_parser):
help=DAEMON_ANALYTICS_HELP,
)
daemon_analytics_parser.add_argument(
"target", help="Analytics file.", choices=completion.Required.FILE
"target",
help="Analytics file.",
metavar="target",
choices=completion.Required.FILE,
)
daemon_analytics_parser.set_defaults(func=CmdDaemonAnalytics)
+1
View File
@@ -105,6 +105,7 @@ def shared_parent_parser():
nargs="*",
help="Limit command scope to these DVC-files. "
"Using -R, directories to search DVC-files in can also be given.",
metavar="targets",
choices=completion.Optional.DVC_FILE,
)
+2
View File
@@ -43,6 +43,7 @@ def add_parser(subparsers, parent_parser):
"targets",
nargs="+",
help="DVC-files to freeze.",
metavar="targets",
choices=completion.Required.DVC_FILE,
)
freeze_parser.set_defaults(func=CmdFreeze)
@@ -59,6 +60,7 @@ def add_parser(subparsers, parent_parser):
"targets",
nargs="+",
help="DVC-files to unfreeze.",
metavar="targets",
choices=completion.Required.DVC_FILE,
)
unfreeze_parser.set_defaults(func=CmdUnfreeze)
+1
View File
@@ -65,6 +65,7 @@ def add_parser(subparsers, parent_parser):
get_parser.add_argument(
"path",
help="Path to a file or directory within the repository",
metavar="path",
choices=completion.Required.FILE,
)
get_parser.add_argument(
+1
View File
@@ -37,6 +37,7 @@ def add_parser(subparsers, parent_parser):
"out",
nargs="?",
help="Destination path to put data to.",
metavar="out",
choices=completion.Optional.DIR,
)
get_parser.set_defaults(func=CmdGetUrl)
+1
View File
@@ -46,6 +46,7 @@ def add_parser(subparsers, parent_parser):
import_parser.add_argument(
"path",
help="Path to a file or directory within the repository",
metavar="path",
choices=completion.Required.FILE,
)
import_parser.add_argument(
+1
View File
@@ -61,6 +61,7 @@ def add_parser(subparsers, parent_parser):
"out",
nargs="?",
help="Destination path to put files to.",
metavar="out",
choices=completion.Optional.DIR,
)
import_parser.add_argument(
+1
View File
@@ -75,6 +75,7 @@ def add_parser(subparsers, parent_parser):
"path",
nargs="?",
help="Path to directory within the repository to list outputs for",
metavar="path",
choices=completion.Optional.DIR,
)
list_parser.set_defaults(func=CmdList)
+1
View File
@@ -170,6 +170,7 @@ def add_parser(subparsers, parent_parser):
"Limit command scope to these metric files. Using -R, "
"directories to search metric files in can also be given."
),
metavar="targets",
choices=completion.Optional.FILE,
)
metrics_show_parser.add_argument(
+5 -1
View File
@@ -39,9 +39,13 @@ def add_parser(subparsers, parent_parser):
move_parser.add_argument(
"src",
help="Source path to a data file or directory.",
metavar="src",
choices=completion.Required.FILE,
)
move_parser.add_argument(
"dst", help="Destination path.", choices=completion.Required.FILE,
"dst",
help="Destination path.",
metavar="dst",
choices=completion.Required.FILE,
)
move_parser.set_defaults(func=CmdMove)
+2
View File
@@ -129,6 +129,7 @@ def add_parser(subparsers, parent_parser):
"targets",
nargs="*",
help="Plots files to visualize. Shows all plots by default.",
metavar="targets",
choices=completion.Optional.FILE,
)
_add_props_arguments(plots_show_parser)
@@ -171,6 +172,7 @@ def add_parser(subparsers, parent_parser):
plots_modify_parser.add_argument(
"target",
help="Metric file to set properties to",
metavar="target",
choices=completion.Required.FILE,
)
_add_props_arguments(plots_modify_parser)
+1
View File
@@ -38,6 +38,7 @@ def add_parser(subparsers, parent_parser):
"targets",
nargs="+",
help="DVC-files to remove.",
metavar="targets",
choices=completion.Required.DVC_FILE,
)
remove_parser.set_defaults(func=CmdRemove)
+1
View File
@@ -72,6 +72,7 @@ def add_parser(subparsers, parent_parser):
"targets",
nargs="*",
help=f"Stages to reproduce. '{PIPELINE_FILE}' by default.",
metavar="targets",
choices=completion.Optional.DVC_FILE,
)
repro_parser.add_argument(
+1
View File
@@ -36,6 +36,7 @@ def add_parser(subparsers, parent_parser):
"targets",
nargs="+",
help="Data files/directories to unprotect.",
metavar="targets",
choices=completion.Required.FILE,
)
unprotect_parser.set_defaults(func=CmdUnprotect)
+1
View File
@@ -36,6 +36,7 @@ def add_parser(subparsers, parent_parser):
"targets",
nargs="+",
help="DVC-files to update.",
metavar="targets",
choices=completion.Required.DVC_FILE,
)
update_parser.add_argument(
+1 -1
View File
@@ -78,7 +78,7 @@ install_requires = [
"tabulate>=0.8.7",
"pygtrie==2.3.2",
"dpath>=2.0.1,<3",
"shtab>=0.0.2",
"shtab>=1.0.2",
]