From cc16b28a26369b12ccffc6daa58e22c62271e231 Mon Sep 17 00:00:00 2001 From: Saugat Pachhai Date: Tue, 12 May 2020 13:41:09 +0000 Subject: [PATCH] diff: autocompletion script for params, and show-md (#3786) --- scripts/completion/dvc.bash | 8 +++++--- scripts/completion/dvc.zsh | 7 +++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/scripts/completion/dvc.bash b/scripts/completion/dvc.bash index 78f966acde..771f233b09 100644 --- a/scripts/completion/dvc.bash +++ b/scripts/completion/dvc.bash @@ -5,7 +5,7 @@ # - https://stackoverflow.com/questions/12933362 _dvc_commands='add cache checkout commit config destroy diff fetch get-url get gc \ - import-url import init install lock list metrics move pipeline plot pull push \ + import-url import init install lock list metrics move params pipeline plot pull push \ remote remove repro root run status unlock unprotect update version' _dvc_options='-h --help -V --version' @@ -21,7 +21,7 @@ _dvc_commit='-f --force -d --with-deps -R --recursive' _dvc_commit_COMPGEN=_dvc_compgen_DVCFiles _dvc_config='-u --unset --local --system --global' _dvc_destroy='-f --force' -_dvc_diff='-t --show-json --show-hash' +_dvc_diff='-t --show-json --show-hash --show-md' _dvc_fetch='-j --jobs -r --remote -a --all-branches -T --all-tags -d --with-deps -R --recursive' _dvc_fetch_COMPGEN=_dvc_compgen_DVCFiles _dvc_gc='-a --all-branches --all-commits -T --all-tags -w --workspace -c --cloud -r --remote -f --force -p --projects -j --jobs' @@ -38,7 +38,7 @@ _dvc_lock_COMPGEN=_dvc_compgen_DVCFiles _dvc_metrics='add diff modify remove show' _dvc_metrics_add='-t --type -x --xpath' _dvc_metrics_add_COMPGEN=_dvc_compgen_files -_dvc_metrics_diff='--targets -t --type -x --xpath -R --show-json' +_dvc_metrics_diff='--targets -t --type -x --xpath -R --show-json --show-md' _dvc_metrics_modify='-t --type -x --xpath' _dvc_metrics_modify_COMPGEN=_dvc_compgen_files _dvc_metrics_remove='' @@ -47,6 +47,8 @@ _dvc_metrics_show='-t --type -x --xpath -a --all-branches -T --all-tags -R --rec _dvc_metrics_show_COMPGEN=_dvc_compgen_files _dvc_move='' _dvc_move_COMPGEN=_dvc_compgen_files +_dvc_params='diff' +_dvc_params_diff='--all --show-json --show-md' _dvc_pipeline='list show' _dvc_pipeline_list='' _dvc_pipeline_show='-c --commands -o --outs --ascii --dot --tree -l --locked' diff --git a/scripts/completion/dvc.zsh b/scripts/completion/dvc.zsh index 8e6fbfbe5d..5fb44e7d14 100644 --- a/scripts/completion/dvc.zsh +++ b/scripts/completion/dvc.zsh @@ -31,6 +31,7 @@ _dvc_commands() { "lock:Lock DVC-file." "metrics:Commands to add, manage, collect and display metrics." "move:Rename or move a DVC controlled data file or a directory." + "params:Commands to display params." "pipeline:Manage pipelines." "pull:Pull data files from a DVC remote storage." "push:Push data files to a DVC remote storage." @@ -102,6 +103,7 @@ _dvc_destroy=( _dvc_diff=( "--show-json[Format the output into a JSON]" "--show-hash[Display hash value for each entry]" + "--show-md[Format the output into a Markdown table]" "1:Old Git commit to compare (defaults to HEAD):" "2:New Git commit to compare (defaults to the current workspace):" ) @@ -182,6 +184,10 @@ _dvc_move=( "2:Destination:" ) +_dvc_params=( + "1:Sub command:(diff)" +) + _dvc_pipeline=( "1:Sub command:(show list)" ) @@ -312,6 +318,7 @@ case $words[1] in list) _arguments $_dvc_global_options $_dvc_list ;; metrics) _arguments $_dvc_global_options $_dvc_metrics ;; move) _arguments $_dvc_global_options $_dvc_move ;; + params) _arguments $_dvc_global_options $_dvc_params ;; pipeline) _arguments $_dvc_global_options $_dvc_pipeline ;; pull) _arguments $_dvc_global_options $_dvc_pull ;; push) _arguments $_dvc_global_options $_dvc_push ;;