Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Generate structured man pages

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
NotificationsYou must be signed in to change notification settings

rust-cli/man

crates.io versionbuild statusdownloadsdocs.rs docs

Generate structured man pages usingroff-rs.

Usage

use man::prelude::*;fnmain(){let page =Manual::new("basic").about("A basic example").author(Author::new("Alice Person").email("alice@person.com")).author(Author::new("Bob Human").email("bob@human.com")).flag(Flag::new().short("-d").long("--debug").help("Enable debug mode"),).flag(Flag::new().short("-v").long("--verbose").help("Enable verbose mode"),).option(Opt::new("output").short("-o").long("--output").help("The file path to write output to"),).example(Example::new().text("run basic in debug mode").command("basic -d").output("Debug Mode: basic will print errors to the console")).custom(Section::new("usage note").paragraph("This program will overwrite any file currently stored at the output path")).render();println!("{}", page);}

Preview by running:

$ cargo run> /tmp/app.man; man /tmp/app.man

Which outputs:

BASIC(1)                       General Commands Manual                          BASIC(1)NAME       basic - A basic exampleSYNOPSISbasic [FLAGS] [OPTIONS]FLAGS-d, --debug              Enable debug mode-v, --verbose              Enable verbose modeOPTIONS-o, --output=output              The file path to write output toUSAGE NOTE       This file will overwrite any file currently stored at the output path.EXIT STATUS0      Successful program execution.1      Unsuccessful program execution.101    The program panicked.EXAMPLES       run basic in debug mode$ basic -d              Debug Mode: basic will print errors to the consoleAUTHORS         Alice Person <alice@person.com>         Bob Human <bob@human.com>                                                                                BASIC(1)

Installation

If usingcargo-edit, install with

$ cargo add man

Otherwise, install by adding to Cargo.toml file's dependency section.

License

MIT ORApache-2.0

About

Generate structured man pages

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp