mirror of
https://github.com/clap-rs/clap
synced 2024-11-14 00:27:13 +00:00
Merge pull request #3278 from epage/about
docs(examples): Steer people to know about about vs long_about
This commit is contained in:
commit
3bda330712
22 changed files with 22 additions and 22 deletions
|
@ -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)]
|
||||
|
|
|
@ -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>,
|
||||
|
|
|
@ -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)]
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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>,
|
||||
|
|
|
@ -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))]
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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>,
|
||||
|
|
|
@ -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>,
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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)]
|
||||
|
|
|
@ -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))]
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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")]
|
||||
|
|
|
@ -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))]
|
||||
|
|
Loading…
Reference in a new issue