clap_complete how to run dynamic.rs example #5806
Answered
by
enricoschaaf
enricoschaaf
asked this question in
Q&A
-
Hi 👋🏽 I am very interested in the dynamic completions, I tried out the example but I did not get it to work. Would it be possible to provide more context? Thanks for working on this 🙏🏽 |
Beta Was this translation helpful? Give feedback.
Answered by
enricoschaaf
Nov 6, 2024
Replies: 1 comment 7 replies
-
Running the examples is a bit awkward because they will registry for completing their binary name and then you need that name within your path. You can also give this a try with a nightly cargo at https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#native-completions |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I solved the issue 🥳 Command::get_bin_name takes the name of the crate in my case and not the name of the binary written in Cargo.toml so the autocomplete script is wrong and never actually calls the binary. Looking at your code snippet made me figure it out 🙏🏽