wide-midnight-7859809/26/2022, 7:39 PM
- even if it's contrived, I like the idea of something like
which kinda indicates that it's acting on the pants instance itself, rather than being a verb for some other work 2. What should the output of said pseudo-goal be? Print the completions to the console? Export to
? This is probably a per-repo file, since it depends on what the installed backend packages are - so it may not be something trivially exported to a completions folder somewhere on the user's filesystem 3. Can this be auto-updated if the backend-packages change?
hundreds-father-40409/26/2022, 7:48 PM
What should the output of said pseudo-goal be?Maybe depends if we want to output for all shells, vs only one?
proud-dentist-2284409/26/2022, 8:23 PM
goal, then maybe people could configure (probably in
) which shells they want: bash, zsh, … Then, plugins could register additional shell types for that goal (with a union). But, shell completion backends would need to be enabled via
so that people can use esoteric shells without forcing projects to add support in their pants.toml And now, I’ve probably veered off into left field… Using the top-level completions would also make it discoverable when people list the available goals.
goal, I can imagine a zsh completion plugin that calls that to add contextual completions on the fly. For the zsh completion, I can imagine an oh-my-zsh plugin that would call
given the user typing
./pants completions test --
to get the valid args in that context.
./pants test --<tab>
wide-midnight-7859809/26/2022, 8:30 PM
called on each ... keystroke?
proud-dentist-2284409/26/2022, 8:31 PM
to ask for completions
wide-midnight-7859809/26/2022, 8:32 PM
proud-dentist-2284409/26/2022, 8:33 PM
wide-midnight-7859809/26/2022, 8:34 PM
proud-dentist-2284409/26/2022, 8:34 PM
wide-midnight-7859809/26/2022, 8:37 PM
That's for when there is a backend package mistake This is on the example-python repo:
./pants --version 0.64s user 0.10s system 26% cpu 2.817 total
./pants --version 0.56s user 0.08s system 78% cpu 0.816 total
./pants completions 0.71s user 0.12s system 60% cpu 1.365 total