mirror of
https://github.com/clap-rs/clap
synced 2024-12-13 14:22:34 +00:00
Show default derive example with coloredhelp
This commit is contained in:
parent
d3b6c1b3f9
commit
ac8a9582f9
1 changed files with 2 additions and 1 deletions
|
@ -135,12 +135,13 @@ The first example shows the simplest way to use `clap`, by defining a struct. If
|
|||
//
|
||||
// This example demonstrates clap's full 'custom derive' style of creating arguments which is the
|
||||
// simplest method of use, but sacrifices some flexibility.
|
||||
use clap::Clap;
|
||||
use clap::{AppSettings, Clap};
|
||||
|
||||
/// This doc string acts as a help message when the user runs '--help'
|
||||
/// as do all doc strings on fields
|
||||
#[derive(Clap)]
|
||||
#[clap(version = "1.0", author = "Kevin K. <kbknapp@gmail.com>")]
|
||||
#[clap(setting = AppSettings::ColoredHelp)]
|
||||
struct Opts {
|
||||
/// Sets a custom config file. Could have been an Option<T> with no default too
|
||||
#[clap(short, long, default_value = "default.conf")]
|
||||
|
|
Loading…
Reference in a new issue