diff --git a/examples/cargo-example-derive.rs b/examples/cargo-example-derive.rs index dfdd799fc19..f9105ea2f81 100644 --- a/examples/cargo-example-derive.rs +++ b/examples/cargo-example-derive.rs @@ -8,7 +8,7 @@ enum CargoCli { } #[derive(clap::Args)] -#[command(author, version, about, long_about = None)] +#[command(version, about, long_about = None)] struct ExampleDeriveArgs { #[arg(long)] manifest_path: Option, diff --git a/examples/demo.rs b/examples/demo.rs index 8e4304a2e60..11430aa19b2 100644 --- a/examples/demo.rs +++ b/examples/demo.rs @@ -2,7 +2,7 @@ use clap::Parser; /// Simple program to greet a person #[derive(Parser, Debug)] -#[command(author, version, about, long_about = None)] +#[command(version, about, long_about = None)] struct Args { /// Name of the person to greet #[arg(short, long)] diff --git a/examples/escaped-positional-derive.rs b/examples/escaped-positional-derive.rs index 719b3d6c214..decffab9c8e 100644 --- a/examples/escaped-positional-derive.rs +++ b/examples/escaped-positional-derive.rs @@ -1,7 +1,7 @@ use clap::Parser; #[derive(Parser)] // requires `derive` feature -#[command(author, version, about, long_about = None)] +#[command(version, about, long_about = None)] struct Cli { #[arg(short = 'f')] eff: bool, diff --git a/examples/pacman.rs b/examples/pacman.rs index 7ab30db953f..07c14013b02 100644 --- a/examples/pacman.rs +++ b/examples/pacman.rs @@ -6,7 +6,6 @@ fn main() { .version("5.2.1") .subcommand_required(true) .arg_required_else_help(true) - .author("Pacman Development Team") // Query subcommand // // Only a few of its arguments are implemented below. diff --git a/examples/tutorial_builder/02_apps.rs b/examples/tutorial_builder/02_apps.rs index 7d98e6cfe4c..b085e0edc21 100644 --- a/examples/tutorial_builder/02_apps.rs +++ b/examples/tutorial_builder/02_apps.rs @@ -3,7 +3,6 @@ use clap::{arg, Command}; fn main() { let matches = Command::new("MyApp") .version("1.0") - .author("Kevin K. ") .about("Does awesome things") .arg(arg!(--two ).required(true)) .arg(arg!(--one ).required(true)) diff --git a/examples/tutorial_derive/01_quick.rs b/examples/tutorial_derive/01_quick.rs index 0edcd251f97..ba68efa70db 100644 --- a/examples/tutorial_derive/01_quick.rs +++ b/examples/tutorial_derive/01_quick.rs @@ -3,7 +3,7 @@ use std::path::PathBuf; use clap::{Parser, Subcommand}; #[derive(Parser)] -#[command(author, version, about, long_about = None)] +#[command(version, about, long_about = None)] struct Cli { /// Optional name to operate on name: Option, diff --git a/examples/tutorial_derive/02_app_settings.rs b/examples/tutorial_derive/02_app_settings.rs index abea13d19fc..bc416246761 100644 --- a/examples/tutorial_derive/02_app_settings.rs +++ b/examples/tutorial_derive/02_app_settings.rs @@ -1,7 +1,7 @@ use clap::Parser; #[derive(Parser)] -#[command(author, version, about, long_about = None)] +#[command(version, about, long_about = None)] #[command(next_line_help = true)] struct Cli { #[arg(long)] diff --git a/examples/tutorial_derive/02_apps.rs b/examples/tutorial_derive/02_apps.rs index 75455efceeb..52aae9e83e2 100644 --- a/examples/tutorial_derive/02_apps.rs +++ b/examples/tutorial_derive/02_apps.rs @@ -2,7 +2,6 @@ use clap::Parser; #[derive(Parser)] #[command(name = "MyApp")] -#[command(author = "Kevin K. ")] #[command(version = "1.0")] #[command(about = "Does awesome things", long_about = None)] struct Cli { diff --git a/examples/tutorial_derive/02_crate.rs b/examples/tutorial_derive/02_crate.rs index 33a7a4ee0fb..5dec591fe03 100644 --- a/examples/tutorial_derive/02_crate.rs +++ b/examples/tutorial_derive/02_crate.rs @@ -1,7 +1,7 @@ use clap::Parser; #[derive(Parser)] -#[command(author, version, about, long_about = None)] // Read from `Cargo.toml` +#[command(version, about, long_about = None)] // Read from `Cargo.toml` struct Cli { #[arg(long)] two: String, diff --git a/examples/tutorial_derive/03_01_flag_bool.rs b/examples/tutorial_derive/03_01_flag_bool.rs index 4f68fc834a4..067ae9e2d74 100644 --- a/examples/tutorial_derive/03_01_flag_bool.rs +++ b/examples/tutorial_derive/03_01_flag_bool.rs @@ -1,7 +1,7 @@ use clap::Parser; #[derive(Parser)] -#[command(author, version, about, long_about = None)] +#[command(version, about, long_about = None)] struct Cli { #[arg(short, long)] verbose: bool, diff --git a/examples/tutorial_derive/03_01_flag_count.rs b/examples/tutorial_derive/03_01_flag_count.rs index 2b8a453ed24..769342b123e 100644 --- a/examples/tutorial_derive/03_01_flag_count.rs +++ b/examples/tutorial_derive/03_01_flag_count.rs @@ -1,7 +1,7 @@ use clap::Parser; #[derive(Parser)] -#[command(author, version, about, long_about = None)] +#[command(version, about, long_about = None)] struct Cli { #[arg(short, long, action = clap::ArgAction::Count)] verbose: u8, diff --git a/examples/tutorial_derive/03_02_option.rs b/examples/tutorial_derive/03_02_option.rs index aad8ef10b2c..5fad3950ef4 100644 --- a/examples/tutorial_derive/03_02_option.rs +++ b/examples/tutorial_derive/03_02_option.rs @@ -1,7 +1,7 @@ use clap::Parser; #[derive(Parser)] -#[command(author, version, about, long_about = None)] +#[command(version, about, long_about = None)] struct Cli { #[arg(short, long)] name: Option, diff --git a/examples/tutorial_derive/03_02_option_mult.rs b/examples/tutorial_derive/03_02_option_mult.rs index 1caa440aaa7..6e928f28326 100644 --- a/examples/tutorial_derive/03_02_option_mult.rs +++ b/examples/tutorial_derive/03_02_option_mult.rs @@ -1,7 +1,7 @@ use clap::Parser; #[derive(Parser)] -#[command(author, version, about, long_about = None)] +#[command(version, about, long_about = None)] struct Cli { #[arg(short, long)] name: Vec, diff --git a/examples/tutorial_derive/03_03_positional.rs b/examples/tutorial_derive/03_03_positional.rs index cf5f4054fbc..5a8f73ebe9d 100644 --- a/examples/tutorial_derive/03_03_positional.rs +++ b/examples/tutorial_derive/03_03_positional.rs @@ -1,7 +1,7 @@ use clap::Parser; #[derive(Parser)] -#[command(author, version, about, long_about = None)] +#[command(version, about, long_about = None)] struct Cli { name: Option, } diff --git a/examples/tutorial_derive/03_03_positional_mult.rs b/examples/tutorial_derive/03_03_positional_mult.rs index bd57a55c81e..ee550a30604 100644 --- a/examples/tutorial_derive/03_03_positional_mult.rs +++ b/examples/tutorial_derive/03_03_positional_mult.rs @@ -1,7 +1,7 @@ use clap::Parser; #[derive(Parser)] -#[command(author, version, about, long_about = None)] +#[command(version, about, long_about = None)] struct Cli { name: Vec, } diff --git a/examples/tutorial_derive/03_04_subcommands.rs b/examples/tutorial_derive/03_04_subcommands.rs index da7c644c704..7a0b0bb1411 100644 --- a/examples/tutorial_derive/03_04_subcommands.rs +++ b/examples/tutorial_derive/03_04_subcommands.rs @@ -1,7 +1,7 @@ use clap::{Parser, Subcommand}; #[derive(Parser)] -#[command(author, version, about, long_about = None)] +#[command(version, about, long_about = None)] #[command(propagate_version = true)] struct Cli { #[command(subcommand)] diff --git a/examples/tutorial_derive/03_04_subcommands_alt.rs b/examples/tutorial_derive/03_04_subcommands_alt.rs index 80b0ec6b958..74d35607093 100644 --- a/examples/tutorial_derive/03_04_subcommands_alt.rs +++ b/examples/tutorial_derive/03_04_subcommands_alt.rs @@ -1,7 +1,7 @@ use clap::{Args, Parser, Subcommand}; #[derive(Parser)] -#[command(author, version, about, long_about = None)] +#[command(version, about, long_about = None)] #[command(propagate_version = true)] struct Cli { #[command(subcommand)] diff --git a/examples/tutorial_derive/03_05_default_values.rs b/examples/tutorial_derive/03_05_default_values.rs index bc33a931abc..543010d3e62 100644 --- a/examples/tutorial_derive/03_05_default_values.rs +++ b/examples/tutorial_derive/03_05_default_values.rs @@ -1,7 +1,7 @@ use clap::Parser; #[derive(Parser)] -#[command(author, version, about, long_about = None)] +#[command(version, about, long_about = None)] struct Cli { #[arg(default_value_t = 2020)] port: u16, diff --git a/examples/tutorial_derive/04_01_enum.rs b/examples/tutorial_derive/04_01_enum.rs index 41410a3bdc5..95e1fdb64e9 100644 --- a/examples/tutorial_derive/04_01_enum.rs +++ b/examples/tutorial_derive/04_01_enum.rs @@ -1,7 +1,7 @@ use clap::{Parser, ValueEnum}; #[derive(Parser)] -#[command(author, version, about, long_about = None)] +#[command(version, about, long_about = None)] struct Cli { /// What mode to run the program in #[arg(value_enum)] diff --git a/examples/tutorial_derive/04_02_parse.rs b/examples/tutorial_derive/04_02_parse.rs index a40c6828b6e..860ecbc23c1 100644 --- a/examples/tutorial_derive/04_02_parse.rs +++ b/examples/tutorial_derive/04_02_parse.rs @@ -1,7 +1,7 @@ use clap::Parser; #[derive(Parser)] -#[command(author, version, about, long_about = None)] +#[command(version, about, long_about = None)] struct Cli { /// Network port to use #[arg(value_parser = clap::value_parser!(u16).range(1..))] diff --git a/examples/tutorial_derive/04_02_validate.rs b/examples/tutorial_derive/04_02_validate.rs index 3391d5b72d5..7e493738ca0 100644 --- a/examples/tutorial_derive/04_02_validate.rs +++ b/examples/tutorial_derive/04_02_validate.rs @@ -3,7 +3,7 @@ use std::ops::RangeInclusive; use clap::Parser; #[derive(Parser)] -#[command(author, version, about, long_about = None)] +#[command(version, about, long_about = None)] struct Cli { /// Network port to use #[arg(value_parser = port_in_range)] diff --git a/examples/tutorial_derive/04_03_relations.rs b/examples/tutorial_derive/04_03_relations.rs index 8657ebe8372..0bbbd8a6fc2 100644 --- a/examples/tutorial_derive/04_03_relations.rs +++ b/examples/tutorial_derive/04_03_relations.rs @@ -1,7 +1,7 @@ use clap::{Args, Parser}; #[derive(Parser)] -#[command(author, version, about, long_about = None)] +#[command(version, about, long_about = None)] struct Cli { #[command(flatten)] vers: Vers, diff --git a/examples/tutorial_derive/04_04_custom.rs b/examples/tutorial_derive/04_04_custom.rs index a84b5ed5fe9..4acf7652974 100644 --- a/examples/tutorial_derive/04_04_custom.rs +++ b/examples/tutorial_derive/04_04_custom.rs @@ -2,7 +2,7 @@ use clap::error::ErrorKind; use clap::{CommandFactory, Parser}; #[derive(Parser)] -#[command(author, version, about, long_about = None)] +#[command(version, about, long_about = None)] struct Cli { /// set version manually #[arg(long, value_name = "VER")] diff --git a/examples/tutorial_derive/05_01_assert.rs b/examples/tutorial_derive/05_01_assert.rs index 42ebda9a1ec..2d6ae909eb8 100644 --- a/examples/tutorial_derive/05_01_assert.rs +++ b/examples/tutorial_derive/05_01_assert.rs @@ -1,7 +1,7 @@ use clap::Parser; #[derive(Parser)] -#[command(author, version, about, long_about = None)] +#[command(version, about, long_about = None)] struct Cli { /// Network port to use port: u16, diff --git a/src/_derive/_tutorial/chapter_1.rs b/src/_derive/_tutorial/chapter_1.rs index b58ae6e0c2c..3fabc171525 100644 --- a/src/_derive/_tutorial/chapter_1.rs +++ b/src/_derive/_tutorial/chapter_1.rs @@ -8,7 +8,7 @@ //! #![doc = include_str!("../../../examples/tutorial_derive/02_apps.md")] //! -//! 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. +//! You can use [`#[command(version, about)]` attribute defaults][super#command-attributes] on the struct to fill these fields in from your `Cargo.toml` file. //! //! ```rust #![doc = include_str!("../../../examples/tutorial_derive/02_crate.rs")] diff --git a/src/_derive/mod.rs b/src/_derive/mod.rs index 2ad242d5923..83169dacbfa 100644 --- a/src/_derive/mod.rs +++ b/src/_derive/mod.rs @@ -148,6 +148,7 @@ //! - `author [= ]`: [`Command::author`][crate::Command::author] //! - When not present: no author set //! - Without ``: defaults to [crate `authors`](https://doc.rust-lang.org/cargo/reference/manifest.html#the-authors-field) +//! - **NOTE:** A custom [`help_template`][crate::Command::help_template] is needed for author to show up. //! - `about [= ]`: [`Command::about`][crate::Command::about] //! - When not present: [Doc comment summary](#doc-comments) //! - Without ``: [crate `description`](https://doc.rust-lang.org/cargo/reference/manifest.html#the-description-field) ([`Parser`][crate::Parser] container)