Man generator spec (Proposal) #4616
Replies: 3 comments 10 replies
-
Being discussed at #3365 |
Beta Was this translation helpful? Give feedback.
-
EXAMPLES, AUTHORS, FILES, etc I feel like would be part of #3354 |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
I am basing my suggestions on the
mdoc
page. There are a lot of different small issues with the generator, I wanted to consolidate them here.Compile time
build.rs
unless you want to keep track of 2 differentCommand
s. There is a way to reuse code, but there should be a macro to make it seamless for the user [^1]Subcommand
.#[derive(Parser)]
users should callArgs::command()
. (And imo they really should be able to pass anything that isInto<Command>
orInto<ManSource>
in case there is something that is lost while you convert.)man page structure
DESCRIPTION
is duplicated in NAMEEXAMPLES
[^2],AUTHORS
FILES
,DIAGNOSTICS
,ERRORS
, etc)[^2]Footnotes
#[path = "src/clap.rs"] mod clap;
module annotation you can reimport code, but what I feel this should look like is more oflet man = man_from!(clap::Args);
./examples
and somehow generate both working executables that can be used incargo test
and the man page. One option is to importmain()
from main.rs, but set upparse()
to yield a preprogrammed struct.Any feedback is welcome.
Beta Was this translation helpful? Give feedback.
All reactions