-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API design #2
Comments
Not sure but my guess is more a matter of single sourcing
Granted, if this is a lower level API, then it might make sense to not have all of that built in |
Merged
I think clap actually has a really neat API. Taking some notes on the structure would probably be a good idea. https://github.com/kbknapp/clap-rs#quick-example extern crate clap;
extern crate clap_md;
use clap::{App, AppSettings, Arg, SubCommand};
use clap_md::app_to_md;
fn main() {
let a = App::new("testapp")
.about("Pointless application")
.setting(AppSettings::SubcommandRequiredElseHelp)
.author("Katharina Fey <[email protected]>")
// .author("Yosh Wuyts <[email protected]")
.long_about("Lorem Ipsum bla bla bla")
.arg(Arg::with_name("debug").short("d").help("Make program output debug messages"))
.arg(Arg::with_name("output").short("o").takes_value(true).help("Output File"))
.subcommand(SubCommand::with_name("foo").arg(Arg::with_name("bar").short("b").long("barr")));
let markdown = app_to_md(&a, 1).unwrap();
println!("{}", markdown);
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The current API is more of a sketch of what this could look like. On chat there seems to be a sentiment that the current API might not suffice for more complex man pages.
I'm opening this issue to gather examples of complex man pages, and to help shape the design of the crate. This should hopefully allow us to get a deeper understanding of which API we can, and should expose.
The text was updated successfully, but these errors were encountered: