This can be done with clap; see https://dev.to/kbknapp/cli-shell-completions-in-rust-37g1.
There are two options:
-
Compile time generation. This would generate the completions at compile time, and then we would have
to distribute them in a package manager or have users install them manually.
-
Runtime generation. We could add a feature/flag to jd init so that it also prints out the completion script.
This would work well, since users would already have it sourced in their shell config.
I think that the runtime generation is the better option.
This can be done with clap; see https://dev.to/kbknapp/cli-shell-completions-in-rust-37g1.
There are two options:
Compile time generation. This would generate the completions at compile time, and then we would have
to distribute them in a package manager or have users install them manually.
Runtime generation. We could add a feature/flag to
jd initso that it also prints out the completion script.This would work well, since users would already have it sourced in their shell config.
I think that the runtime generation is the better option.