diff --git a/src/etc/_cargo b/src/etc/_cargo index 4e03ba77ff2..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 \ @@ -40,7 +39,7 @@ case $state in '(-h, --help)'{-h,--help}'[show help message]' \ '(-j, --jobs)'{-j,--jobs}'[number of jobs to run in parallel]' \ "${command_scope_spec[@]}" \ - '--manifest-path=[path to manifest]: :files -/' \ + '--manifest-path=[path to manifest]: :_files -/' \ '--no-default-features[do not build the default features]' \ '(-p,--package)'{-p=,--package=}'[package to build]:packages:_get_package_names' \ '--release=[build in release mode]' \ @@ -53,7 +52,7 @@ case $state in clean) _arguments \ '(-h, --help)'{-h,--help}'[show help message]' \ - '--manifest-path=[path to manifest]' \ + '--manifest-path=[path to manifest]: :_files -/' \ '(-p,--package)'{-p=,--package=}'[package to clean]:packages:_get_package_names' \ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ '--release[whether or not to clean release artifacts]' \ @@ -67,7 +66,7 @@ case $state in '--features=[space separated feature list]' \ '(-h, --help)'{-h,--help}'[show help message]' \ '(-j, --jobs)'{-j,--jobs}'[number of jobs to run in parallel]' \ - '--manifest-path=[path to manifest]' \ + '--manifest-path=[path to manifest]: :_files -/' \ '--no-deps[do not build docs for dependencies]' \ '--no-default-features[do not build the default features]' \ '--open[open docs in browser after the build]' \ @@ -82,7 +81,7 @@ case $state in fetch) _arguments \ '(-h, --help)'{-h,--help}'[show help message]' \ - '--manifest-path=[path to manifest]' \ + '--manifest-path=[path to manifest]: :_files -/' \ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ '--color=:colorization option:(auto always never)' \ @@ -91,7 +90,7 @@ case $state in generate-lockfile) _arguments \ '(-h, --help)'{-h,--help}'[show help message]' \ - '--manifest-path=[path to manifest]' \ + '--manifest-path=[path to manifest]: :_files -/' \ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ '--color=:colorization option:(auto always never)' \ @@ -148,7 +147,7 @@ case $state in locate-project) _arguments \ '(-h, --help)'{-h,--help}'[show help message]' \ - '--manifest-path=[path to manifest]' \ + '--manifest-path=[path to manifest]: :_files -/' \ ;; login) @@ -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]' \ @@ -188,7 +200,7 @@ case $state in _arguments \ '(-h, --help)'{-h,--help}'[show help message]' \ '(-l, --list)'{-l,--list}'[print files included in a package without making one]' \ - '--manifest-path=[path to manifest]' \ + '--manifest-path=[path to manifest]: :_files -/' \ '--no-metadata[ignore warnings about a lack of human-usable metadata]' \ '--no-verify[do not build to verify contents]' \ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ @@ -199,7 +211,7 @@ case $state in pkgid) _arguments \ '(-h, --help)'{-h,--help}'[show help message]' \ - '--manifest-path=[path to manifest]' \ + '--manifest-path=[path to manifest]: :_files -/' \ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ '--color=:colorization option:(auto always never)' \ @@ -209,7 +221,7 @@ case $state in _arguments \ '(-h, --help)'{-h,--help}'[show help message]' \ '--host=[Host to set the token for]' \ - '--manifest-path=[path to manifest]' \ + '--manifest-path=[path to manifest]: :_files -/' \ '--no-verify[Do not verify tarball until before publish]' \ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ '--token[token to use when uploading]' \ @@ -220,7 +232,7 @@ case $state in read-manifest) _arguments \ '(-h, --help)'{-h,--help}'[show help message]' \ - '--manifest-path=[path to manifest]' \ + '--manifest-path=[path to manifest]: :_files -/' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ '--color=:colorization option:(auto always never)' \ ;; @@ -231,7 +243,7 @@ case $state in '--features=[space separated feature list]' \ '(-h, --help)'{-h,--help}'[show help message]' \ '(-j, --jobs)'{-j,--jobs}'[number of jobs to run in parallel]' \ - '--manifest-path=[path to manifest]' \ + '--manifest-path=[path to manifest]: :_files -/' \ '--bin=[name of the bin target]' \ '--no-default-features[do not build the default features]' \ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ @@ -291,7 +303,7 @@ case $state in '--features=[space separated feature list]' \ '(-h, --help)'{-h,--help}'[show help message]' \ '(-j, --jobs)'{-j,--jobs}'[number of jobs to run in parallel]' \ - '--manifest-path=[path to manifest]' \ + '--manifest-path=[path to manifest]: :_files -/' \ '--test=[test name]: :_test_names' \ '--no-default-features[do not build the default features]' \ '--no-fail-fast[run all tests regardless of failure]' \ @@ -319,7 +331,7 @@ case $state in _arguments \ '--aggressive=[force dependency update]' \ '(-h, --help)'{-h,--help}'[show help message]' \ - '--manifest-path=[path to manifest]' \ + '--manifest-path=[path to manifest]: :_files -/' \ '(-p,--package)'{-p=,--package=}'[package to update]:packages:__get_package_names' \ '--precise=[update single dependency to PRECISE]: :' \ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ @@ -330,7 +342,7 @@ case $state in verify-project) _arguments \ '(-h, --help)'{-h,--help}'[show help message]' \ - '--manifest-path=[path to manifest]' \ + '--manifest-path=[path to manifest]: :_files -/' \ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ '--color=:colorization option:(auto always never)' \ @@ -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'