From 1e161e839f5b544955096b30b01841307b4e4d2f Mon Sep 17 00:00:00 2001 From: Frederick Zhang Date: Mon, 24 Sep 2018 18:02:03 +1000 Subject: [PATCH] fix subcommands completion --- plugins/cargo/_cargo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/cargo/_cargo b/plugins/cargo/_cargo index 01089dff4..7d7d9b2d8 100644 --- a/plugins/cargo/_cargo +++ b/plugins/cargo/_cargo @@ -421,7 +421,7 @@ local -a commands;commands=( 'verify-project:check Cargo.toml' 'version:show version information' 'yank:remove pushed file from index' -$( cargo --list | sed -n '1!p' | tr -d ' ' | egrep -v "^bench$|^build$|^clean$|^doc$|^fetch$|^generate-lockfile$|^git-checkout$|^help$|^init$|^install$|^locate-project$|^login$|^metadata$|^new$|^owner$|^package$|^pkgid$|^publish$|^read-manifest$|^run$|^rustc$|^rustdoc$|^search$|^test$|^uninstall$|^update$|^verify-project$|^version$|^yank$" | sed -r "s/(.*)/echo \"\1:$\(cargo help \1 2>\&1 | head -n 1\)\"/" | sh ) +$( cargo --list | sed -n '1!p' | tr -s ' ' | cut -d ' ' -f 2 | egrep -v "^bench$|^build$|^clean$|^doc$|^fetch$|^generate-lockfile$|^git-checkout$|^help$|^init$|^install$|^locate-project$|^login$|^metadata$|^new$|^owner$|^package$|^pkgid$|^publish$|^read-manifest$|^run$|^rustc$|^rustdoc$|^search$|^test$|^uninstall$|^update$|^verify-project$|^version$|^yank$" | sed -r "s/(.*)/echo \"\1:$\(cargo help \1 2>\&1 | head -n 1\)\"/" | sh ) ) _describe 'command' commands