Conversation
|
Should be rebased to master |
77edfeb to
0aaa0ff
Compare
|
Needs another rebase |
AladW
left a comment
There was a problem hiding this comment.
If the completions are generated at build-time, can we use zsh instead and re-use the descriptions defined in completions/zsh/_aur?
0aaa0ff to
a7515bf
Compare
|
Zsh script instead of Perl parser (?!) |
Rewrite the generator in zsh. The script sources completions/zsh/_aur and overrides _arguments to capture the option specs each _aur-* function would pass to the completion system. It then emits fish 'complete' directives from those captured specs. Sourcing the file lets zsh handle its own parsing, so brace expansion, quoting, and parameter expansion all resolve naturally without a hand-written parser. The bash completion is unchanged. Only fish generation moves to the zsh-sourcing approach. Co-Authored-By: Claude Opus
a7515bf to
e536bf1
Compare
|
Please leave out the part from the commit message
from the commit message since no normal person would have ever come up with such an absurd idea in the first place |
| source zsh/_aur | ||
|
|
||
| # Subcommand descriptions live in cmds[X]="Y" assignments inside _aur(). | ||
| # That hash is local, so read the function's text. |
|
|
||
| fish_escape() { print -r -n -- "${1//\'/\\\'}" } | ||
|
|
||
| # Emit a bucket of brace-expanded aliases as one 'complete' directive. |
|
Even though it now looks somewhat plausible,
It also seems likely that minute changes to zsh completions, will break the fish completions. In other words, I don't think this idea is feasible anymore. Fish completions should limit themselves to output from --dump-options and forget about descriptions. This can be changed if an actual person looks at this, who has a working knowledge on how fish and its completions work. |
|
Fair enough, closing. |
Fish shell completions for aurutils, generated at build time from
--dump-optionslike the bash completions already are.Easier to maintain - the subcommands are discovered from
lib/and each script's flags are queried directly.Depends on #1263 for the Perl scripts to support
--dump-options.Also fixes
command_opts.shto run scripts through their shebangs instead of hardcoding bash, so Perl scripts work during generation.Closes #1260