Skip to content

Commit ef45f2d

Browse files
authored
Merge pull request #5317 from epage/author
docs: Adjust how we approach `author`
2 parents 0134f45 + 64ae186 commit ef45f2d

26 files changed

+23
-25
lines changed

examples/cargo-example-derive.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ enum CargoCli {
88
}
99

1010
#[derive(clap::Args)]
11-
#[command(author, version, about, long_about = None)]
11+
#[command(version, about, long_about = None)]
1212
struct ExampleDeriveArgs {
1313
#[arg(long)]
1414
manifest_path: Option<std::path::PathBuf>,

examples/demo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use clap::Parser;
22

33
/// Simple program to greet a person
44
#[derive(Parser, Debug)]
5-
#[command(author, version, about, long_about = None)]
5+
#[command(version, about, long_about = None)]
66
struct Args {
77
/// Name of the person to greet
88
#[arg(short, long)]

examples/escaped-positional-derive.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use clap::Parser;
22

33
#[derive(Parser)] // requires `derive` feature
4-
#[command(author, version, about, long_about = None)]
4+
#[command(version, about, long_about = None)]
55
struct Cli {
66
#[arg(short = 'f')]
77
eff: bool,

examples/pacman.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ fn main() {
66
.version("5.2.1")
77
.subcommand_required(true)
88
.arg_required_else_help(true)
9-
.author("Pacman Development Team")
109
// Query subcommand
1110
//
1211
// Only a few of its arguments are implemented below.

examples/tutorial_builder/02_apps.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use clap::{arg, Command};
33
fn main() {
44
let matches = Command::new("MyApp")
55
.version("1.0")
6-
.author("Kevin K. <kbknapp@gmail.com>")
76
.about("Does awesome things")
87
.arg(arg!(--two <VALUE>).required(true))
98
.arg(arg!(--one <VALUE>).required(true))

examples/tutorial_derive/01_quick.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::path::PathBuf;
33
use clap::{Parser, Subcommand};
44

55
#[derive(Parser)]
6-
#[command(author, version, about, long_about = None)]
6+
#[command(version, about, long_about = None)]
77
struct Cli {
88
/// Optional name to operate on
99
name: Option<String>,

examples/tutorial_derive/02_app_settings.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use clap::Parser;
22

33
#[derive(Parser)]
4-
#[command(author, version, about, long_about = None)]
4+
#[command(version, about, long_about = None)]
55
#[command(next_line_help = true)]
66
struct Cli {
77
#[arg(long)]

examples/tutorial_derive/02_apps.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ use clap::Parser;
22

33
#[derive(Parser)]
44
#[command(name = "MyApp")]
5-
#[command(author = "Kevin K. <kbknapp@gmail.com>")]
65
#[command(version = "1.0")]
76
#[command(about = "Does awesome things", long_about = None)]
87
struct Cli {

examples/tutorial_derive/02_crate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use clap::Parser;
22

33
#[derive(Parser)]
4-
#[command(author, version, about, long_about = None)] // Read from `Cargo.toml`
4+
#[command(version, about, long_about = None)] // Read from `Cargo.toml`
55
struct Cli {
66
#[arg(long)]
77
two: String,

examples/tutorial_derive/03_01_flag_bool.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use clap::Parser;
22

33
#[derive(Parser)]
4-
#[command(author, version, about, long_about = None)]
4+
#[command(version, about, long_about = None)]
55
struct Cli {
66
#[arg(short, long)]
77
verbose: bool,

examples/tutorial_derive/03_01_flag_count.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use clap::Parser;
22

33
#[derive(Parser)]
4-
#[command(author, version, about, long_about = None)]
4+
#[command(version, about, long_about = None)]
55
struct Cli {
66
#[arg(short, long, action = clap::ArgAction::Count)]
77
verbose: u8,

examples/tutorial_derive/03_02_option.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use clap::Parser;
22

33
#[derive(Parser)]
4-
#[command(author, version, about, long_about = None)]
4+
#[command(version, about, long_about = None)]
55
struct Cli {
66
#[arg(short, long)]
77
name: Option<String>,

examples/tutorial_derive/03_02_option_mult.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use clap::Parser;
22

33
#[derive(Parser)]
4-
#[command(author, version, about, long_about = None)]
4+
#[command(version, about, long_about = None)]
55
struct Cli {
66
#[arg(short, long)]
77
name: Vec<String>,

examples/tutorial_derive/03_03_positional.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use clap::Parser;
22

33
#[derive(Parser)]
4-
#[command(author, version, about, long_about = None)]
4+
#[command(version, about, long_about = None)]
55
struct Cli {
66
name: Option<String>,
77
}

examples/tutorial_derive/03_03_positional_mult.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use clap::Parser;
22

33
#[derive(Parser)]
4-
#[command(author, version, about, long_about = None)]
4+
#[command(version, about, long_about = None)]
55
struct Cli {
66
name: Vec<String>,
77
}

examples/tutorial_derive/03_04_subcommands.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use clap::{Parser, Subcommand};
22

33
#[derive(Parser)]
4-
#[command(author, version, about, long_about = None)]
4+
#[command(version, about, long_about = None)]
55
#[command(propagate_version = true)]
66
struct Cli {
77
#[command(subcommand)]

examples/tutorial_derive/03_04_subcommands_alt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use clap::{Args, Parser, Subcommand};
22

33
#[derive(Parser)]
4-
#[command(author, version, about, long_about = None)]
4+
#[command(version, about, long_about = None)]
55
#[command(propagate_version = true)]
66
struct Cli {
77
#[command(subcommand)]

examples/tutorial_derive/03_05_default_values.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use clap::Parser;
22

33
#[derive(Parser)]
4-
#[command(author, version, about, long_about = None)]
4+
#[command(version, about, long_about = None)]
55
struct Cli {
66
#[arg(default_value_t = 2020)]
77
port: u16,

examples/tutorial_derive/04_01_enum.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use clap::{Parser, ValueEnum};
22

33
#[derive(Parser)]
4-
#[command(author, version, about, long_about = None)]
4+
#[command(version, about, long_about = None)]
55
struct Cli {
66
/// What mode to run the program in
77
#[arg(value_enum)]

examples/tutorial_derive/04_02_parse.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use clap::Parser;
22

33
#[derive(Parser)]
4-
#[command(author, version, about, long_about = None)]
4+
#[command(version, about, long_about = None)]
55
struct Cli {
66
/// Network port to use
77
#[arg(value_parser = clap::value_parser!(u16).range(1..))]

examples/tutorial_derive/04_02_validate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::ops::RangeInclusive;
33
use clap::Parser;
44

55
#[derive(Parser)]
6-
#[command(author, version, about, long_about = None)]
6+
#[command(version, about, long_about = None)]
77
struct Cli {
88
/// Network port to use
99
#[arg(value_parser = port_in_range)]

examples/tutorial_derive/04_03_relations.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use clap::{Args, Parser};
22

33
#[derive(Parser)]
4-
#[command(author, version, about, long_about = None)]
4+
#[command(version, about, long_about = None)]
55
struct Cli {
66
#[command(flatten)]
77
vers: Vers,

examples/tutorial_derive/04_04_custom.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use clap::error::ErrorKind;
22
use clap::{CommandFactory, Parser};
33

44
#[derive(Parser)]
5-
#[command(author, version, about, long_about = None)]
5+
#[command(version, about, long_about = None)]
66
struct Cli {
77
/// set version manually
88
#[arg(long, value_name = "VER")]

examples/tutorial_derive/05_01_assert.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use clap::Parser;
22

33
#[derive(Parser)]
4-
#[command(author, version, about, long_about = None)]
4+
#[command(version, about, long_about = None)]
55
struct Cli {
66
/// Network port to use
77
port: u16,

src/_derive/_tutorial/chapter_1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//!
99
#![doc = include_str!("../../../examples/tutorial_derive/02_apps.md")]
1010
//!
11-
//! You can use [`#[command(author, version, about)]` attribute defaults][super#command-attributes] on the struct to fill these fields in from your `Cargo.toml` file.
11+
//! You can use [`#[command(version, about)]` attribute defaults][super#command-attributes] on the struct to fill these fields in from your `Cargo.toml` file.
1212
//!
1313
//! ```rust
1414
#![doc = include_str!("../../../examples/tutorial_derive/02_crate.rs")]

src/_derive/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@
148148
//! - `author [= <expr>]`: [`Command::author`][crate::Command::author]
149149
//! - When not present: no author set
150150
//! - Without `<expr>`: defaults to [crate `authors`](https://doc.rust-lang.org/cargo/reference/manifest.html#the-authors-field)
151+
//! - **NOTE:** A custom [`help_template`][crate::Command::help_template] is needed for author to show up.
151152
//! - `about [= <expr>]`: [`Command::about`][crate::Command::about]
152153
//! - When not present: [Doc comment summary](#doc-comments)
153154
//! - Without `<expr>`: [crate `description`](https://doc.rust-lang.org/cargo/reference/manifest.html#the-description-field) ([`Parser`][crate::Parser] container)

0 commit comments

Comments
 (0)