From c7e2986151ac56847a947d281c03f4c1cd720676 Mon Sep 17 00:00:00 2001 From: Knight Date: Sun, 5 Jun 2016 18:08:20 +0800 Subject: [PATCH] Add zsh autocompletion to subcommand metadata --- src/etc/_cargo | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/etc/_cargo b/src/etc/_cargo index c2d9770d771..529aa89f745 100644 --- a/src/etc/_cargo +++ b/src/etc/_cargo @@ -16,7 +16,6 @@ _arguments \ case $state in args) - #TODO: add path completion to manifest-path options case $words[1] in bench) _arguments \ @@ -160,6 +159,19 @@ case $state in '--color=:colorization option:(auto always never)' \ ;; + metadata) + _arguments \ + '(-h, --help)'{-h,--help}'[show help message]' \ + '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ + '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ + "--no-deps[output information only about the root package and don't fetch dependencies]" \ + '--no-default-features[do not include the default feature]' \ + '--manifest-path=[path to manifest]: :_files -/' \ + '--features=[space separated feature list]' \ + '--format-version=[format version(default: 1)]' \ + '--color=:colorization option:(auto always never)' \ + ;; + new) _arguments \ '--bin[use binary template]' \ @@ -373,6 +385,7 @@ local -a commands;commands=( 'install:install a Rust binary' 'locate-project:print "Cargo.toml" location' 'login:login to remote server' +'metadata:the metadata for a project in json' 'new:create a new project' 'owner:manage the owners of a crate on the registry' 'package:assemble local package into a distributable tarball'