Merge pull request #3278 from epage/about

docs(examples): Steer people to know about about vs long_about
This commit is contained in:
Ed Page 2022-01-10 19:01:10 -06:00 committed by GitHub
commit 3bda330712
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 22 additions and 22 deletions

View file

@ -37,7 +37,7 @@ use clap::Parser;
/// Simple program to greet a person
#[derive(Parser, Debug)]
#[clap(about, version, author)]
#[clap(author, version, about, long_about = None)]
struct Args {
/// Name of the person to greet
#[clap(short, long)]

View file

@ -8,7 +8,7 @@ enum Cargo {
}
#[derive(clap::Args)]
#[clap(about, author, version)]
#[clap(author, version, about, long_about = None)]
struct ExampleDerive {
#[clap(long, parse(from_os_str))]
manifest_path: Option<std::path::PathBuf>,

View file

@ -4,7 +4,7 @@ use clap::Parser;
/// Simple program to greet a person
#[derive(Parser, Debug)]
#[clap(about, version, author)]
#[clap(author, version, about, long_about = None)]
struct Args {
/// Name of the person to greet
#[clap(short, long)]

View file

@ -258,7 +258,7 @@ for individual arguments can be specified via [`Arg::help`] and [`Arg::long_help
# use clap::Parser;
#[derive(Parser)]
#[clap(about = "I am a program and I work, just pass `-h`")]
#[clap(about = "I am a program and I work, just pass `-h`", long_about = None)]
struct Foo {
#[clap(short, help = "Pass `-h` and you'll see me!")]
bar: String,

View file

@ -1,7 +1,7 @@
use clap::Parser;
#[derive(Parser, Debug, PartialEq)]
#[clap(about, author, version)]
#[clap(author, version, about, long_about = None)]
struct Opt {
// Default parser for `try_from_str` is FromStr::from_str.
// `impl FromStr for bool` parses `true` or `false` so this

View file

@ -3,7 +3,7 @@
use clap::Parser;
#[derive(Parser)]
#[clap(about, version, author)]
#[clap(author, version, about, long_about = None)]
struct Cli {
#[clap(short = 'f')]
eff: bool,

View file

@ -8,7 +8,7 @@ use clap::{AppSettings, Parser, Subcommand};
/// A fictional versioning CLI
#[derive(Parser)]
#[clap(name = "git")]
#[clap(about = "A fictional versioning CLI")]
#[clap(about = "A fictional versioning CLI", long_about = None)]
struct Cli {
#[clap(subcommand)]
command: Commands,

View file

@ -3,7 +3,7 @@ use std::path::PathBuf;
use clap::{Parser, Subcommand};
#[derive(Parser)]
#[clap(author, version, about)]
#[clap(author, version, about, long_about = None)]
struct Cli {
/// Optional name to operate on
name: Option<String>,

View file

@ -1,7 +1,7 @@
use clap::{AppSettings, Parser};
#[derive(Parser)]
#[clap(author, version, about)]
#[clap(author, version, about, long_about = None)]
#[clap(global_setting(AppSettings::AllArgsOverrideSelf))]
#[clap(global_setting(AppSettings::DeriveDisplayOrder))]
#[clap(global_setting(AppSettings::AllowNegativeNumbers))]

View file

@ -4,7 +4,7 @@ use clap::Parser;
#[clap(name = "MyApp")]
#[clap(author = "Kevin K. <kbknapp@gmail.com>")]
#[clap(version = "1.0")]
#[clap(about = "Does awesome things")]
#[clap(about = "Does awesome things", long_about = None)]
struct Cli {
#[clap(long)]
two: String,

View file

@ -1,7 +1,7 @@
use clap::Parser;
#[derive(Parser)]
#[clap(author, version, about)]
#[clap(author, version, about, long_about = None)]
struct Cli {
#[clap(long)]
two: String,

View file

@ -1,7 +1,7 @@
use clap::Parser;
#[derive(Parser)]
#[clap(author, version, about)]
#[clap(author, version, about, long_about = None)]
struct Cli {
#[clap(short, long)]
verbose: bool,

View file

@ -1,7 +1,7 @@
use clap::Parser;
#[derive(Parser)]
#[clap(author, version, about)]
#[clap(author, version, about, long_about = None)]
struct Cli {
#[clap(short, long, parse(from_occurrences))]
verbose: usize,

View file

@ -1,7 +1,7 @@
use clap::Parser;
#[derive(Parser)]
#[clap(author, version, about)]
#[clap(author, version, about, long_about = None)]
struct Cli {
#[clap(short, long)]
name: Option<String>,

View file

@ -1,7 +1,7 @@
use clap::Parser;
#[derive(Parser)]
#[clap(author, version, about)]
#[clap(author, version, about, long_about = None)]
struct Cli {
name: Option<String>,
}

View file

@ -1,7 +1,7 @@
use clap::{AppSettings, Parser, Subcommand};
#[derive(Parser)]
#[clap(author, version, about)]
#[clap(author, version, about, long_about = None)]
#[clap(global_setting(AppSettings::PropagateVersion))]
#[clap(global_setting(AppSettings::UseLongFormatForHelpSubcommand))]
struct Cli {

View file

@ -1,7 +1,7 @@
use clap::Parser;
#[derive(Parser)]
#[clap(author, version, about)]
#[clap(author, version, about, long_about = None)]
struct Cli {
#[clap(default_value_t = String::from("alice"))]
name: String,

View file

@ -1,7 +1,7 @@
use clap::{ArgEnum, Parser};
#[derive(Parser)]
#[clap(author, version, about)]
#[clap(author, version, about, long_about = None)]
struct Cli {
/// What mode to run the program in
#[clap(arg_enum)]

View file

@ -1,7 +1,7 @@
use clap::Parser;
#[derive(Parser)]
#[clap(author, version, about)]
#[clap(author, version, about, long_about = None)]
struct Cli {
/// Network port to use
#[clap(parse(try_from_str))]

View file

@ -1,7 +1,7 @@
use clap::{ArgGroup, Parser};
#[derive(Parser)]
#[clap(author, version, about)]
#[clap(author, version, about, long_about = None)]
#[clap(group(
ArgGroup::new("vers")
.required(true)

View file

@ -1,7 +1,7 @@
use clap::{ErrorKind, IntoApp, Parser};
#[derive(Parser)]
#[clap(author, version, about)]
#[clap(author, version, about, long_about = None)]
struct Cli {
/// set version manually
#[clap(long, value_name = "VER")]

View file

@ -1,7 +1,7 @@
use clap::Parser;
#[derive(Parser)]
#[clap(author, version, about)]
#[clap(author, version, about, long_about = None)]
struct Cli {
/// Network port to use
#[clap(parse(try_from_str))]