Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bash syntax errors reported when loading cargo shell completions #1799

Closed
jimmycuadra opened this issue Apr 24, 2019 · 2 comments
Closed

Bash syntax errors reported when loading cargo shell completions #1799

jimmycuadra opened this issue Apr 24, 2019 · 2 comments
Labels

Comments

@jimmycuadra
Copy link
Contributor

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

  1. Install latest rustup. I'm using rustup 1.18.0 (8603e2c 2019-04-22).
  2. Run source $(rustc --print sysroot)/etc/bash_completion.d/cargo in a shell.
  3. 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 (8603e2c 2019-04-22)

@kinnison
Copy link
Contributor

Hi, the completions come from Cargo rather than rustup itself, this is probably better filed against rust-lang/cargo

@rbtcollins
Copy link
Contributor

Fixed in rust-lang/cargo#6905

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants