This is a tracking issue for man page creation. The initial goal is to provide a flow to generate man pages from Structopt instances. This is a specialization of https://github.com/rust-lang-nursery/cli-wg/issues/23.
Example
The goal is to be able to use code similar to this.
// src/cli.rs
extern crate structopt;
#[derive(StructOpt, Debug)]
pub struct Opts {
/// TCP port to listen to.
#[structopt(
short = "p", long = "port", env = "PORT", default_value = "8080"
)]
port: usize,
}
// src/lib.rs
#[macro_use]
extern crate structopt;
pub mod cli;
// build.rs
extern crate structop_to_man;
use structopt::{clap::Shell, StructOpt};
include!("src/lib.rs");
fn main() {
let outdir = ::std::env::var_os("OUT_DIR").expect("OUT_DIR not found.");
let mut app = cli::Opts::clap();
app.gen_completions("my_app", Shell::Fish, &outdir); // generate shell completions
structop_to_man::gen_man(&app, &outdir); // generate man pages
}
Checklist
I think the following steps are required to make this happen.
This is a tracking issue for man page creation. The initial goal is to provide a flow to generate man pages from Structopt instances. This is a specialization of https://github.com/rust-lang-nursery/cli-wg/issues/23.
Example
The goal is to be able to use code similar to this.
Checklist
I think the following steps are required to make this happen.
Writer).Writer.