Bash syntax errors reported when loading cargo shell completions #6874
Closed
Description
opened on Apr 24, 2019
This is a re-report of rust-lang/rustup#1799, per the comment it received.
Problem
The cargo command completion shell script produces syntax errors when loaded:
-bash: /redacted/.rustup/toolchains/stable-x86_64-apple-darwin/etc/bash_completion.d/cargo: line 82: syntax error in conditional expression: unexpected token `('
-bash: /redacted/.rustup/toolchains/stable-x86_64-apple-darwin/etc/bash_completion.d/cargo: line 82: syntax error near `@(t'
-bash: /redacted/.rustup/toolchains/stable-x86_64-apple-darwin/etc/bash_completion.d/cargo: line 82: ` if [[ "${cmd}" = @(test|bench) ]]; then'
Steps
- Install latest rustup. I'm using rustup 1.18.0 (8603e2c56 2019-04-22).
- Run
source $(rustc --print sysroot)/etc/bash_completion.d/cargo
in a shell. - Observe output.
Possible Solution(s)
Notes
Output of bash --version
:
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18)
Copyright (C) 2007 Free Software Foundation, Inc.
Output of rustup --version
: rustup 1.18.0 (8603e2c56 2019-04-22)
Output of cargo --version
: cargo 1.34.0 (6789d8a 2019-04-01)
Activity