Skip to content

Bash syntax errors reported when loading cargo shell completions #6874

Closed
rust-lang/rust
#60596
@jimmycuadra

Description

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

  1. Install latest rustup. I'm using rustup 1.18.0 (8603e2c56 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 (8603e2c56 2019-04-22)
Output of cargo --version: cargo 1.34.0 (6789d8a 2019-04-01)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-completionsArea: shell completionsC-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions