Skip to content

Have method for file path #11

@yoshuawuyts

Description

@yoshuawuyts

Applies to #10. Per https://github.com/killercup/clap-man-demo/blob/master/build.rs#L17-L19, we should have a method to generate a file name.

API

Current

for man in gen_manuals(&app) {
    let name = "clap-man-demo.1"; // FIXME: Extract this from man!
    let path = PathBuf::from(&outdir).join(name);
    let mut out = fs::File::create(&path).unwrap();
    out.write_all(man.render().as_bytes()).unwrap();
}

Proposed

for man in gen_manuals(&app) {
    let path = PathBuf::from(env!("CARGO_PKG_NAME")).push(man.path());
    fs::write(path, man.render())?;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions