-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate shell completions and man page #122
Conversation
resolved the merge conflicts |
Nice PR!
Just saw your CI file and learned some stuff from it, seems like you can upload artifacts for each different job while keeping the different name for each of them, but can you optionally not upload the binaries for some of the jobs? (like we do currently).
The odds of this colliding is high?
Would be nice if you could gzip them CI before uploading, but I'm a noob when it comes to CI, is it easy to do? (@vrmiguel managed to learn github actions and did everything for |
Actually I don't upload any artifacts, the jobs only upload stuff to the releases
Should be possible, the main difference is more uses of matrix
If you run
I should've mentioned that artifacts are in |
Oh yes, there's this, so no, leave them uncompressed, I'll probably need to create a script to help with releases anyway, so I could add this step to it. |
resolved merge conflicts |
Resolved some more conflicts that appeared, thanks for the contribution and sorry for the delay! |
@figsoda have you tried out the zsh completion? Bash is working here but zsh is not. |
I did not, I don't use zsh Fish worked fine for me |
zsh completion is not working because of the following in
The
Fixes the issue, I don't know about the generation process so just fixed it by hand in the meantime. |
@yigitsever does this fix it for you? |
@figsoda it does, didn't even realize the typo... |
Moved some parts of
cli.rs
toopts.rs
,ouch::cli::{Opts, QuestionPolicy, Subcommand}
are moved toouch::{Opts, QuestionPolicy, Subcommand}
This uses a build script to generate completions when
GEN_COMPLETIONS=1
is present, this generates completions to$OUT_DIR/completions
, for example:GEN_COMPLETIONS=1 cargo build
would generate completions totarget/debug/build/ouch-*/out/completions
GEN_COMPLETIONS=1 cargo build --release --target x86_64-unknown-linux-musl
would generate completions totarget/x86_64-unknown-linux-musl/release/build/ouch-*/out/completions
A few more artifacts are generated in the completions in the
x86_64-musl
job:completions
help2man
and uploaded toouch.1
Design choices:
OUT_DIR
, which is what rust/cargo recommends, but it also makes paths incredibly long and can possibly collide (when globbing with*
) when completions are generated multiple timesSide notes:
build.rs
sincehelp2man
excepts an executable, not a string