Show default derive example with coloredhelp

This commit is contained in:
Ivan Tham 2021-04-04 12:08:57 +08:00 committed by GitHub
parent d3b6c1b3f9
commit ac8a9582f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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")]