Skip to content

Commit 35c827a

Browse files
committed
feat(cli): complete --config after command
Adds support for completing --config values with _filedir, but only when they appear after the cargo subcommand.
1 parent e7246c6 commit 35c827a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/etc/cargo.bashcomp.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ _cargo()
3636
local opt_verbose='-v --verbose'
3737
local opt_quiet='-q --quiet'
3838
local opt_color='--color'
39-
local opt_common="$opt_help $opt_verbose $opt_quiet $opt_color"
39+
local opt_config='--config'
40+
local opt_common="$opt_help $opt_verbose $opt_quiet $opt_color $opt_config"
4041
local opt_pkg_spec='-p --package --all --exclude --workspace'
4142
local opt_pkg='-p --package'
4243
local opt_feat='-F --features --all-features --no-default-features'
@@ -143,6 +144,9 @@ _cargo()
143144
--target-dir|--path)
144145
_filedir -d
145146
;;
147+
--config)
148+
_filedir
149+
;;
146150
help)
147151
_ensure_cargo_commands_cache_filled
148152
COMPREPLY=( $( compgen -W "$__cargo_commands_cache" -- "$cur" ) )

0 commit comments

Comments
 (0)