Skip to content

poetry.bash-completion has multiple syntax errors #4572

Closed
python-poetry/cleo
#247
@pythoninthegrass

Description

  • I am on the latest Poetry version.

  • I have searched the issues of this repo and believe that this is not a duplicate.

  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

  • OS version and name: macOS 10.14.6 Mojave

  • Poetry version: Poetry (version 1.2.0a2)

  • Link of a Gist with the contents of your pyproject.toml file: N/A

Issue

Generated a completion file for bash via poetry completions bash > /usr/local/etc/profile.d/poetry.bash-completion due to poetry completions bash > /etc/bash_completion.d/poetry.bash-completion not having the /etc/bash_completion.d directory on Mac. Sourced in .bashrc and wound up with a bunch of syntax errors that I had to comment out (i.e., not use.)

.bashrc

. /usr/local/etc/profile.d/poetry.bash-completion

/usr/local/etc/profile.d/poetry.bash-completion

-bash: /usr/local/etc/profile.d/poetry.bash-completion: line 40: syntax error near unexpected token `clear'
-bash: /usr/local/etc/profile.d/poetry.bash-completion: line 40: `            (cache clear)'
$ which poetry
/usr/local/bin/poetry
$ source ~/.bashrc
-bash: /usr/local/etc/profile.d/poetry.bash-completion: line 44: syntax error near unexpected token `list'
-bash: /usr/local/etc/profile.d/poetry.bash-completion: line 44: `            (cache list)'
$ source ~/.bashrc
-bash: /usr/local/etc/profile.d/poetry.bash-completion: line 56: syntax error near unexpected token `info'
-bash: /usr/local/etc/profile.d/poetry.bash-completion: line 56: `            (debug info)'
$ source ~/.bashrc
-bash: /usr/local/etc/profile.d/poetry.bash-completion: line 60: syntax error near unexpected token `resolve'
-bash: /usr/local/etc/profile.d/poetry.bash-completion: line 60: `            (debug resolve)'
$ source ~/.bashrc
-bash: /usr/local/etc/profile.d/poetry.bash-completion: line 64: syntax error near unexpected token `info'
-bash: /usr/local/etc/profile.d/poetry.bash-completion: line 64: `            (env info)'
$ source ~/.bashrc
-bash: /usr/local/etc/profile.d/poetry.bash-completion: line 68: syntax error near unexpected token `list'
-bash: /usr/local/etc/profile.d/poetry.bash-completion: line 68: `            (env list)'
$ source ~/.bashrc
-bash: /usr/local/etc/profile.d/poetry.bash-completion: line 72: syntax error near unexpected token `remove'
-bash: /usr/local/etc/profile.d/poetry.bash-completion: line 72: `            (env remove)'
$ source ~/.bashrc
-bash: /usr/local/etc/profile.d/poetry.bash-completion: line 76: syntax error near unexpected token `use'
-bash: /usr/local/etc/profile.d/poetry.bash-completion: line 76: `            (env use)'
$ source ~/.bashrc
-bash: /usr/local/etc/profile.d/poetry.bash-completion: line 108: syntax error near unexpected token `add'
-bash: /usr/local/etc/profile.d/poetry.bash-completion: line 108: `            (plugin add)'
$ source ~/.bashrc
-bash: /usr/local/etc/profile.d/poetry.bash-completion: line 112: syntax error near unexpected token `remove'
-bash: /usr/local/etc/profile.d/poetry.bash-completion: line 112: `            (plugin remove)'
$ !!
source ~/.bashrc
-bash: /usr/local/etc/profile.d/poetry.bash-completion: line 116: syntax error near unexpected token `show'
-bash: /usr/local/etc/profile.d/poetry.bash-completion: line 116: `            (plugin show)'
$ !!
source ~/.bashrc
-bash: /usr/local/etc/profile.d/poetry.bash-completion: line 136: syntax error near unexpected token `update'
-bash: /usr/local/etc/profile.d/poetry.bash-completion: line 136: `            (self update)'
$
$ !!
source ~/.bashrc
-bash: /usr/local/etc/profile.d/poetry.bash-completion: line 148: syntax error near unexpected token `add'
-bash: /usr/local/etc/profile.d/poetry.bash-completion: line 148: `            (source add)'
$ !!
source ~/.bashrc
-bash: /usr/local/etc/profile.d/poetry.bash-completion: line 152: syntax error near unexpected token `remove'
-bash: /usr/local/etc/profile.d/poetry.bash-completion: line 152: `            (source remove)'
$ !!
source ~/.bashrc
-bash: /usr/local/etc/profile.d/poetry.bash-completion: line 156: syntax error near unexpected token `show'
-bash: /usr/local/etc/profile.d/poetry.bash-completion: line 156: `            (source show)'
$ !!
source ~/.bashrc
$

Full poetry.bash-completion

Metadata

Assignees

No one assigned

    Labels

    area/cliRelated to the command linekind/bugSomething isn't working as expectedstatus/external-issueIssue is caused by external project (platform, dep, etc)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions