-
Essentially, I was routed to bpaf because clap does not support dynamic autocomplete. And my 5min test confirms that it does what I minimally need it to do(!), but I'm not especially a fan of the My particular command already has/needs a What I'd ideally love to do is define my own subcommand |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Second API endpoint is // prepare arguments here, easiest is probably to read them directly from OS
// and check if it starts with `cmd --shell zsh shell completion`.
// if it is - you make `Args` from leftovers and set the revision
// if not - you make `Args` from all of them minus the name
// then you run it like that
match your_parser().run_inner(args) {
Ok(t) => t,
Err(err) => std::process::exit(err.exit_code()),
} |
Beta Was this translation helpful? Give feedback.
That is correct.
Sort of. You can call your own executable with
--bpaf-complete-style-zsh
or similar option and capture the output. Users will have to do it at most once so it should be fine. Alternatively you can call this flag as part of your test suite, store the output somewhere and produce it when user calls the command you want. Or put those snippets…