Closed majecty closed 4 years ago
@foriequal0 Can I try this issue?
Since most of the content of the man page has the same content as the help message, I'll try a solution that extracts a man page from a help message.
Let me summarize the possible options:
Generate a man page from a handwritten markup file
Generate a man page using Rust's man crate
Generate a man page from the help message
3.1. Parse a help text and creates a man page
3.2 Parse the doc comments of the Args
struct
Use another CLI option parser library that generates man page automatically.
It seems 4 is viable. structopt
uses clap under the hood. You might be able to find a way to convert them to clap object.
A feature that generates a man page will be added in the clap's version 3 which is not available yet. Since I can get a Clap::App
object from StructOpt trait, however, I'll try to generate a man page using the Clap::App
object.
I've tried to use clap::App to get the arguments' data, and failed.
Clap is not exposing FlagBuilder
type, AnyArg
type, and etc that are required to extract argument value and help message easily.
Closed by #84
The PR #50 added a man page. We need a method to manage the man page in a smart way.
There are too many methods to create a man page. We need to research them and choose one.