-
-
Notifications
You must be signed in to change notification settings - Fork 204
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
Add manpage generation using xtask. #1059
Conversation
Hey again! Thanks for the PR, I really like the idea. I'm wondering if there is a way to reuse the Clap Also, I guess the configuration is more complex than the command line arguments, so a manpage for that or having it as part of the ncspot manpage would be cool. I have looked at the |
Agreed, I think having a manpage for configuration would be a big improvement. I also thought about having the double instances of the clap command, and I think by making a library for ncspot (src/lib.rs) and putting it in there as a public static or const could help with that. Then both parts of the code could use it as if ncspot was a library. I'll work on this further when I have some time 🙂 |
This changes the default behavior of the `cargo run` command for xtasks to hide the compilation info. This makes sense as xtask's are run as a program, and showing the compilation info every time clutters stdout with unrelated info.
Moving the `clap::Command` used internally by ncspot to a library allows it to be easily shared between different packages (xtask and ncspot itself). This commit also reworks the xtasks to use clap for parsing the xtask arguments, which simplifies writing new xtasks.
When more xtasks get added, it would make sense to have a `generate-all` subcommand that executes all xtasks, which wouldn't be able to have options for every separate subcommand. Therefore the `output` argument should be optional, and by default output to the `misc` directory which contains extra metadata files already.
Update the README to include information for packagers. The information includes provided files as well as info on how to generate some of them.
With this commit, I think the man page generation using xtask could be ready. It doesn't include the configuration information as I think it would make more sense to provide this information the same way Alacritty and some other programs do, using a default configuration file with added comments that explain the purpose of each option (I could make a separate PR for that). If adding the configuration to the man page would be preferred over the 'default configuration' approach, I'll happily add it. I also added a bit of info about the provided metadata files to the README for packaging ncspot. I hope that's ok. |
Very cool, merged. Thanks! |
This commit introduces semi-automatic manpage generation using the xtask workflow. This automates generation of manpages using the provided clap Command struct. I only wanted to suggest it for now, so I'm making it a draft.