[cargo] Add dynamic --package completions

[ci skip]
This commit is contained in:
Mahmoud Al-Qudsi 2020-09-03 13:41:10 -05:00
parent 3062994645
commit 326fd8d750

View file

@ -94,3 +94,9 @@ complete -c cargo -x -n '__fish_seen_subcommand_from update' -l precise -d 'Upda
complete -c cargo -x -n '__fish_seen_subcommand_from yank' -l vers -d 'The version to yank or un-yank'
complete -c cargo -n '__fish_seen_subcommand_from yank' -l undo -d 'Undo a yank, putting a version back into the index'
function __fish_cargo_packages
find . -name Cargo.toml | string replace -rf '.*/([^/]+)/?Cargo.toml' '$1'
end
complete -c cargo -n '__fish_seen_subcommand_from run test build debug check' -l package \
-xa "(__fish_cargo_packages)"