@@ -10,6 +10,7 @@ _cargo()
10
10
11
11
local vcs=' git hg none'
12
12
local color=' auto always never'
13
+ local msg_format=' human json'
13
14
14
15
local opt_help=' -h --help'
15
16
local opt_verbose=' -v --verbose'
@@ -20,38 +21,41 @@ _cargo()
20
21
local opt_feat=' --features --all-features --no-default-features'
21
22
local opt_mani=' --manifest-path'
22
23
local opt_jobs=' -j --jobs'
24
+ local opt_force=' -f --force'
25
+ local opt_test=' --test --bench'
26
+ local opt_lock=' --frozen --locked'
23
27
24
28
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 "
31
35
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"
33
37
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"
36
40
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"
52
56
local opt__verify_project=" ${opt__fetch} "
53
57
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"
55
59
56
60
if [[ $cword -eq 1 ]]; then
57
61
if [[ " $cur " == -* ]]; then
@@ -67,6 +71,9 @@ _cargo()
67
71
--color)
68
72
COMPREPLY=( $( compgen -W " $color " -- " $cur " ) )
69
73
;;
74
+ --message-format)
75
+ COMPREPLY=( $( compgen -W " $msg_format " -- " $cur " ) )
76
+ ;;
70
77
--manifest-path)
71
78
_filedir toml
72
79
;;
0 commit comments