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

Auto complete script for Linux using BASH is broken #202

Closed
luciorq opened this issue Nov 15, 2023 · 0 comments
Closed

Auto complete script for Linux using BASH is broken #202

luciorq opened this issue Nov 15, 2023 · 0 comments
Labels
bug an unexpected problem or unintended behavior

Comments

@luciorq
Copy link

luciorq commented Nov 15, 2023

The BASH Shell completion script in the current release (v.0.6.0) contains non parsable strings for the subcommand:

wget https://github.com/r-lib/rig/releases/download/latest/rig-linux-latest.tar.gz
tar -xzf rig-linux-latest.tar.gz
source share/bash-completion/completions/rig.bash

Output:

bash: share/bash-completion/completions/rig.bash: line 15: syntax error near unexpected token `____'
bash: share/bash-completion/completions/rig.bash: line 15: `            RIG ____ The R Installation Manager,add)'

By inspecting the Bash completion script, clap is really adding the wrong strings in the case statement starting at line 11.

  11   │       case "${cmd},${i}" in
  12   │             ",$1")
  13   │                 cmd="rig"
  14   │                 ;;
  15   │             RIG ____ The R Installation Manager,add)
  16   │                 cmd="RIG ____ The R Installation Manager__add"
  17   │                 ;;
  18   │             RIG ____ The R Installation Manager,available)
  19   │                 cmd="RIG ____ The R Installation Manager__available"
  20   │                 ;;
  21   │             RIG ____ The R Installation Manager,default)
  22   │                 cmd="RIG ____ The R Installation Manager__default"
  23   │                 ;;
....
 156   │             RIG ____ The R Installation Manager__system__help,help)
 157   │                 cmd="RIG ____ The R Installation Manager__system__help__help"
 158   │                 ;;
 159   │             RIG ____ The R Installation Manager__system__help,make-links)
 160   │                 cmd="RIG ____ The R Installation Manager__system__help__make__links"
 161   │                 ;;
 162   │             RIG ____ The R Installation Manager__system__help,setup-user-lib)
 163   │                 cmd="RIG ____ The R Installation Manager__system__help__setup__user__lib"
 164   │                 ;;
 165   │             *)
 166   │                 ;;
 167   │         esac

I can't really suggest any solution, but could be something changed on clap itself, since it was working properly in previous versions of rig.

Thank you for the amazing tool! Using it everyday!

@luciorq luciorq changed the title Auto complete for Linux using BASH is broken Auto complete script for Linux using BASH is broken Nov 15, 2023
@gaborcsardi gaborcsardi added the bug an unexpected problem or unintended behavior label Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants