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 autocompletion adds command description to completed line #1508

Closed
averms opened this issue Oct 18, 2021 · 2 comments · Fixed by #1509
Closed

Bash autocompletion adds command description to completed line #1508

averms opened this issue Oct 18, 2021 · 2 comments · Fixed by #1509

Comments

@averms
Copy link

averms commented Oct 18, 2021

This is pretty much #1443 except I think I know how to reproduce it. I'm using podman as the program because I was told (containers/podman#12005) it uses cobra.

  1. Add TAB: menu-complete to .inputrc.
  2. Open bash and type podman --c<TAB>
  3. Note that podman --cgroup-manager (Cgroup manager to use ("cgroupfs"|"systemd")) is added to the current line.
  4. Press enter and get bash: syntax error near unexpected token `('

It is fixed with --no-descriptions, which I don't mind using but I just wanted to make sure the bug is chronicled.

@marckhouzam
Copy link
Collaborator

I can reproduce this, thanks @averms.
I am not familiar with the option TAB: menu-complete so I will have to investigate further.

marckhouzam added a commit to VilledeMontreal/cobra that referenced this issue Oct 19, 2021
spf13#1508

Based on the documentation found here
https://www.gnu.org/software/bash/manual/html_node/Commands-For-Completion.html
we do special handling for the cases:
- menu-complete/menu-complete-backward
- insert-completions

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
marckhouzam added a commit to VilledeMontreal/cobra that referenced this issue Oct 19, 2021
spf13#1508

Based on the documentation found here
https://www.gnu.org/software/bash/manual/html_node/Commands-For-Completion.html
we do special handling for the cases:
- menu-complete/menu-complete-backward
- insert-completions

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
@marckhouzam
Copy link
Collaborator

I've posted a fix in #1509.
/cc @Luap99

marckhouzam added a commit to VilledeMontreal/cobra that referenced this issue Oct 19, 2021
spf13#1508

Based on the documentation found here
https://www.gnu.org/software/bash/manual/html_node/Commands-For-Completion.html
we remove descriptions for the following completion types:
- menu-complete
- menu-complete-backward
- insert-completions

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
marckhouzam added a commit to VilledeMontreal/cobra that referenced this issue Oct 21, 2021
spf13#1508

Based on the documentation found here
https://www.gnu.org/software/bash/manual/html_node/Commands-For-Completion.html
we remove descriptions for the following completion types:
- menu-complete
- menu-complete-backward
- insert-completions

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
marckhouzam added a commit to marckhouzam/cobra-completion-testing that referenced this issue Oct 21, 2021
These tests cover the issue: spf13/cobra#1508
and the corresponding fix: spf13/cobra#1509

Signed-off-by: Marc Khouzam <marc.khouzam@gmail.com>
marckhouzam added a commit to marckhouzam/cobra-completion-testing that referenced this issue Oct 21, 2021
These tests cover the issue: spf13/cobra#1508
and the corresponding fix: spf13/cobra#1509

Signed-off-by: Marc Khouzam <marc.khouzam@gmail.com>
umarcor pushed a commit to umarcor/cobra that referenced this issue Nov 5, 2021
spf13#1508

Based on the documentation found here
https://www.gnu.org/software/bash/manual/html_node/Commands-For-Completion.html
we remove descriptions for the following completion types:
- menu-complete
- menu-complete-backward
- insert-completions

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
umarcor pushed a commit to umarcor/cobra that referenced this issue Nov 15, 2021
spf13#1508

Based on the documentation found here
https://www.gnu.org/software/bash/manual/html_node/Commands-For-Completion.html
we remove descriptions for the following completion types:
- menu-complete
- menu-complete-backward
- insert-completions

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
umarcor pushed a commit to umarcor/cobra that referenced this issue Nov 16, 2021
spf13#1508

Based on the documentation found here
https://www.gnu.org/software/bash/manual/html_node/Commands-For-Completion.html
we remove descriptions for the following completion types:
- menu-complete
- menu-complete-backward
- insert-completions

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
umarcor pushed a commit to umarcor/cobra that referenced this issue Nov 25, 2021
spf13#1508

Based on the documentation found here
https://www.gnu.org/software/bash/manual/html_node/Commands-For-Completion.html
we remove descriptions for the following completion types:
- menu-complete
- menu-complete-backward
- insert-completions

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
jpmcb pushed a commit that referenced this issue Dec 7, 2021
#1508

Based on the documentation found here
https://www.gnu.org/software/bash/manual/html_node/Commands-For-Completion.html
we remove descriptions for the following completion types:
- menu-complete
- menu-complete-backward
- insert-completions

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
umarcor pushed a commit to umarcor/cobra that referenced this issue Dec 7, 2021
spf13#1508

Based on the documentation found here
https://www.gnu.org/software/bash/manual/html_node/Commands-For-Completion.html
we remove descriptions for the following completion types:
- menu-complete
- menu-complete-backward
- insert-completions

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
lincheney added a commit to lincheney/fzf-tab-completion that referenced this issue Mar 5, 2023
fixes #65
related: spf13/cobra#1508
Some completion scripts use $COMP_TYPE to give out different candidates
for different $COMP_TYPE.
Tell them we are like menu-completion so that they give something
compatible with fzf
muscliary pushed a commit to muscliary/cobra that referenced this issue Sep 12, 2023
spf13/cobra#1508

Based on the documentation found here
https://www.gnu.org/software/bash/manual/html_node/Commands-For-Completion.html
we remove descriptions for the following completion types:
- menu-complete
- menu-complete-backward
- insert-completions

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants