Skip to content

Commit aa3f1d0

Browse files
committed
Update bash completion
1 parent af0cef3 commit aa3f1d0

File tree

1 file changed

+32
-25
lines changed

1 file changed

+32
-25
lines changed

src/etc/cargo.bashcomp.sh

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ _cargo()
1010

1111
local vcs='git hg none'
1212
local color='auto always never'
13+
local msg_format='human json'
1314

1415
local opt_help='-h --help'
1516
local opt_verbose='-v --verbose'
@@ -20,38 +21,41 @@ _cargo()
2021
local opt_feat='--features --all-features --no-default-features'
2122
local opt_mani='--manifest-path'
2223
local opt_jobs='-j --jobs'
24+
local opt_force='-f --force'
25+
local opt_test='--test --bench'
26+
local opt_lock='--frozen --locked'
2327

2428
local opt___nocmd="$opt_common -V --version --list"
25-
local opt__bench="$opt_common $opt_pkg $opt_feat $opt_mani $opt_jobs --target --lib --bin --test --bench --example --no-run"
26-
local opt__build="$opt_common $opt_pkg $opt_feat $opt_mani $opt_jobs --target --lib --bin --test --bench --example --release"
27-
local opt__check="$opt_common $opt_pkg $opt_feat $opt_mani $opt_jobs --target --lib --bin --example"
28-
local opt__clean="$opt_common $opt_pkg $opt_mani --target --release"
29-
local opt__doc="$opt_common $opt_pkg $opt_feat $opt_mani $opt_jobs --target --open --no-deps --release"
30-
local opt__fetch="$opt_common $opt_mani"
29+
local opt__bench="$opt_common $opt_pkg $opt_feat $opt_mani $opt_lock $opt_jobs $opt_test --message-format --target --lib --bin --example --no-run"
30+
local opt__build="$opt_common $opt_pkg $opt_feat $opt_mani $opt_lock $opt_jobs $opt_test --message-format --target --lib --bin --example --release"
31+
local opt__check="$opt_common $opt_pkg $opt_feat $opt_mani $opt_lock $opt_jobs $opt_test --message-format --target --lib --bin --example --release"
32+
local opt__clean="$opt_common $opt_pkg $opt_mani $opt_lock --target --release"
33+
local opt__doc="$opt_common $opt_pkg $opt_feat $opt_mani $opt_lock $opt_jobs --message-format --bin --lib --target --open --no-deps --release"
34+
local opt__fetch="$opt_common $opt_mani $opt_lock"
3135
local opt__generate_lockfile="${opt__fetch}"
32-
local opt__git_checkout="$opt_common --reference --url"
36+
local opt__git_checkout="$opt_common $opt_lock --reference --url"
3337
local opt__help="$opt_help"
34-
local opt__init="$opt_common --bin --name --vcs"
35-
local opt__install="$opt_common $opt_feat $opt_jobs --bin --branch --debug --example --git --list --path --rev --root --tag --vers"
38+
local opt__init="$opt_common $opt_lock --bin --lib --name --vcs"
39+
local opt__install="$opt_common $opt_feat $opt_jobs $opt_lock $opt_force --bin --branch --debug --example --git --list --path --rev --root --tag --vers"
3640
local opt__locate_project="$opt_mani -h --help"
37-
local opt__login="$opt_common --host"
38-
local opt__metadata="$opt_common $opt_feat $opt_mani --format-version"
39-
local opt__new="$opt_common --vcs --bin --name"
40-
local opt__owner="$opt_common -a --add -r --remove -l --list --index --token"
41-
local opt__package="$opt_common $opt_mani -l --list --no-verify --no-metadata"
42-
local opt__pkgid="${opt__fetch}"
43-
local opt__publish="$opt_common $opt_mani --host --token --no-verify"
44-
local opt__read_manifest="$opt_help $opt_verbose $opt_mani $opt_color"
45-
local opt__run="$opt_common $opt_feat $opt_mani $opt_jobs --target --bin --example --release"
46-
local opt__rustc="$opt_common $opt_pkg $opt_feat $opt_mani $opt_jobs --target --lib --bin --test --bench --example --release"
47-
local opt__rustdoc="$opt_common $opt_pkg $opt_feat $opt_mani $opt_jobs --target --lib --bin --test --bench --example --release --open"
48-
local opt__search="$opt_common --host"
49-
local opt__test="$opt_common $opt_pkg $opt_feat $opt_mani $opt_jobs --target --lib --bin --test --bench --example --no-run --release --no-fail-fast"
50-
local opt__uninstall="$opt_common --bin --root"
51-
local opt__update="$opt_common $opt_pkg $opt_mani --aggressive --precise"
41+
local opt__login="$opt_common $opt_lock --host"
42+
local opt__metadata="$opt_common $opt_feat $opt_mani $opt_lock --format-version --no-deps"
43+
local opt__new="$opt_common $opt_lock --vcs --bin --lib --name"
44+
local opt__owner="$opt_common $opt_lock -a --add -r --remove -l --list --index --token"
45+
local opt__package="$opt_common $opt_mani $opt_lock $opt_jobs --allow-dirty -l --list --no-verify --no-metadata"
46+
local opt__pkgid="${opt__fetch} $opt_pkg"
47+
local opt__publish="$opt_common $opt_mani $opt_lock $opt_jobs --allow-dirty --dry-run --host --token --no-verify"
48+
local opt__read_manifest="$opt_help $opt_verbose $opt_mani $opt_color --no-deps"
49+
local opt__run="$opt_common $opt_feat $opt_mani $opt_lock $opt_jobs --message-format --target --bin --example --release"
50+
local opt__rustc="$opt_common $opt_pkg $opt_feat $opt_mani $opt_lock $opt_jobs $opt_test --message-format --profile --target --lib --bin --example --release"
51+
local opt__rustdoc="$opt_common $opt_pkg $opt_feat $opt_mani $opt_lock $opt_jobs $opt_test --message-format --target --lib --bin --example --release --open"
52+
local opt__search="$opt_common $opt_lock --host --limit"
53+
local opt__test="$opt_common $opt_pkg $opt_feat $opt_mani $opt_lock $opt_jobs $opt_test --message-format --all --doc --target --lib --bin --example --no-run --release --no-fail-fast"
54+
local opt__uninstall="$opt_common $opt_lock --bin --root"
55+
local opt__update="$opt_common $opt_pkg $opt_mani $opt_lock --aggressive --precise"
5256
local opt__verify_project="${opt__fetch}"
5357
local opt__version="$opt_help $opt_verbose $opt_color"
54-
local opt__yank="$opt_common --vers --undo --index --token"
58+
local opt__yank="$opt_common $opt_lock --vers --undo --index --token"
5559

5660
if [[ $cword -eq 1 ]]; then
5761
if [[ "$cur" == -* ]]; then
@@ -67,6 +71,9 @@ _cargo()
6771
--color)
6872
COMPREPLY=( $( compgen -W "$color" -- "$cur" ) )
6973
;;
74+
--message-format)
75+
COMPREPLY=( $( compgen -W "$msg_format" -- "$cur" ) )
76+
;;
7077
--manifest-path)
7178
_filedir toml
7279
;;

0 commit comments

Comments
 (0)