generate shell completion from specs #42
Replies: 4 comments
-
|
Feel free to experiment. I'm open to this, but I think completions are shell (bash, zsh, fish, etc) specific? |
Beta Was this translation helpful? Give feedback.
-
|
Cool. zsh apparently has a bash compatibility mode. I'm not sure about fish. My inspiration for this is the compleat tool which does something similar and works with bash, zsh, and fish. |
Beta Was this translation helpful? Give feedback.
-
|
Idea for API:
Then the user can choose to map Unknowns / uncertainty: I have only ever used |
Beta Was this translation helpful? Give feedback.
-
|
There was a discussion on slack that was I semi-sidetracked into this area. I wanted to mention carapace as sort of a player in the shell completion space. It's a little bit like the aforementioned This comes with a cost, i.e. users of the completion need to be using carapace to get the niceities, but especially the commands that are 'first-party' in carapace have some nice touches (got an alias that expands to 'git checkout'? carapace will complete that with the branch names of the repo you're working in). From the digging around that I've done into carapace, I don't see a way to use it for generating "shell-native" completions. I'd say it doesn't really want to do that, because then it's somewhat limited by what each shell offers. It does look like the authors have given these ideas some thought, and even written some (short) prose about various approaches, including generators and rolling the completion into the app itself: https://pixi.carapace.sh/porcelainShop.html. I wonder if (and I'm just spitballing here) a good fit for bb.cli might be generating specs that can be fed to things like Or, alternately, is there a case for making a |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm curious how hard this would be.
Maybe have a special flag --complete that takes a partial command line and returns the list of completions to the shell.
Beta Was this translation helpful? Give feedback.
All reactions