Open yschimke opened 5 years ago
Thanks for the suggestion! Fish looks very interesting.
Do you think you’ll be able to provide a pull request?
@remkop Fair question, It's unlikely I will in next 6 months due to
1) I have working code that is app specific 2) I have other project commitments, work+personal projects+OkHttp 3) I'm hesitent to build something like this and not support it. It would be a gamble that utility proved itself enough to gain support within existing users.
So feel free to close this and #726 but it's so palpably close to what I need to delete a tone of code in my own apps.
Feel free to close, this is a suggestion, I don't have plans to actively work on this.
No worries!
It is great if people can contribute a PR, so I always ask :-)
I wasn’t aware of fish shell. I had a quick look and it may be quite straightforward to generate a completion script from the picocli model. It’s still a good suggestion and I don’t plan to close the ticket.
It's a great choice for your interactive (only) shell. And in the examples above you can see how sensible the completion logic is.
complete -c cooee -s V -l version -d 'Output version and exit'
-s is short option, -l is long option with -- prefix, and -d is description.
Yes that looks straightforward.
I need to look a bit further to see how subcommands (and nested sub-subcommands) are handled, and whether there's a facility for completing options that don't look like POSIX short options or GNU long options (like java -version
), but the above looks promising.
Update:
Useful links:
Are there any news?
@benkeil I haven’t looked at this. My time available to spend on picocli is unfortunately extremely limited.
Pull requests are very welcome. 😅
I've made some very dirty proof of concept realization for fish completion in #1925
It successfully generated completion for my simple app, but it's definitely not universal at the moment. I think now it works only for apps with sub-commands.
If anybody interested, they can try to generate completion for their app from #1925
I think fish completion is generally much simpler than bash e.g. see examples below with baked in completions "atlassian github" etc. But the functions at the top actually use the command itself to generate context sensitive completions by calling the code inside the app. Good for URLs etc.
https://github.com/yschimke/cooee-cli/blob/master/src/dist/fish/cooee.fish