DRAFT: poc-manpages
A full automatic build of manpage and completion on build.rs
inspired by https://github.com/bootandy/dust/blob/master/build.rs
Related to: https://github.com/uutils/coreutils/issues/4464
To test, remember to mkdir completion
At the moment the poc is working for a static utility (example here with arch)
Don't really know for now how to add the dynamic call of all uu_app()
src/args.rs is working but not clean
Looking for feedbacks or suggestions
Explanation on how it's working:
- each utils have a
uu_args.rsfile - these
uu_args.rsare standalone and are included insrc/args.rs - in the
build.rs, we collect alluu_args.rsand calluu_app()to access aclap::Command - we generate completionS and man pages for each of them
Note: for now commit name are not great, when the PR is finished I will squash everything
GNU testsuite comparison:
Skip an intermittent issue tests/tail/inotify-dir-recreate (fails in this run but passes in the 'main' branch)
GNU testsuite comparison:
Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)
GNU testsuite comparison:
Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)
This is a huge patch that requires discussions.
Note that we already have completion:
cargo run completion <utility> <shell>
and manpage generation:
cargo run manpage <utility>
This is a huge patch that requires discussions.
Note that we already have completion:
cargo run completion <utility> <shell>and manpage generation:
cargo run manpage <utility>
Yes, I saw that!
With this PR:
- Everything is generated automatically with
build.rs. - It also represents a general improvement of the code. For example, all CLI options are now in a module usable with
options::OPTION_NAME(some utilities were still usingOPTION_NAME), and all utilities follow the same pattern. - We could technically get rid of the
UtilityMapgeneration because we know everything at compile time.
What should be done
- ~~I currently don't really understand why test were passing for
chgrpandchown??! (I undestant thatpermsis gated behing a feature, be that was also the case before ?!)~~ vdiranddirare not currently done, because they depend onuu_ls-> to fix that the simplest solution is to moveuu_ls::uu_appintouu_core(which already is the case forchownandbaseXXutils)- fix the
cspell(quite simple)
I am really sorry but you should not spend more time on it before discussing with the maintainers.
A few points:
- You are doing way too many different things in the same PR.
- The refactor of " all CLI options are now in a module usable with options::OPTION_NAME" should be done a specific PR with prior discussions. We have downstream users of the coreutils like nushell and this will probably impact them.
- "Everything is generated automatically with build.rs", why is it a pro compared to the previous way?
- Why adding all these files in the repo ?
Much better already, thanks!
GNU testsuite comparison:
Skip an intermittent issue tests/tail/inotify-dir-recreate (fails in this run but passes in the 'main' branch)
I'm closing it reading the comment from @tertsdiepraam this PR is introducing to much changes and they are not great
thanks for reviewing it