docs(tutorial): Don't cover 'author' as its not shown

This commit is contained in:
Ed Page 2024-01-17 08:06:56 -06:00
parent 42849cdf5f
commit 64ae186dfc
25 changed files with 22 additions and 25 deletions

View file

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

View file

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

View file

@ -1,7 +1,7 @@
use clap::Parser; use clap::Parser;
#[derive(Parser)] // requires `derive` feature #[derive(Parser)] // requires `derive` feature
#[command(author, version, about, long_about = None)] #[command(version, about, long_about = None)]
struct Cli { struct Cli {
#[arg(short = 'f')] #[arg(short = 'f')]
eff: bool, eff: bool,

View file

@ -6,7 +6,6 @@ fn main() {
.version("5.2.1") .version("5.2.1")
.subcommand_required(true) .subcommand_required(true)
.arg_required_else_help(true) .arg_required_else_help(true)
.author("Pacman Development Team")
// Query subcommand // Query subcommand
// //
// Only a few of its arguments are implemented below. // Only a few of its arguments are implemented below.

View file

@ -3,7 +3,6 @@ use clap::{arg, Command};
fn main() { fn main() {
let matches = Command::new("MyApp") let matches = Command::new("MyApp")
.version("1.0") .version("1.0")
.author("Kevin K. <kbknapp@gmail.com>")
.about("Does awesome things") .about("Does awesome things")
.arg(arg!(--two <VALUE>).required(true)) .arg(arg!(--two <VALUE>).required(true))
.arg(arg!(--one <VALUE>).required(true)) .arg(arg!(--one <VALUE>).required(true))

View file

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

View file

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

View file

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

View file

@ -1,7 +1,7 @@
use clap::Parser; use clap::Parser;
#[derive(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 { struct Cli {
#[arg(long)] #[arg(long)]
two: String, two: String,

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,7 +1,7 @@
use clap::{Parser, Subcommand}; use clap::{Parser, Subcommand};
#[derive(Parser)] #[derive(Parser)]
#[command(author, version, about, long_about = None)] #[command(version, about, long_about = None)]
#[command(propagate_version = true)] #[command(propagate_version = true)]
struct Cli { struct Cli {
#[command(subcommand)] #[command(subcommand)]

View file

@ -1,7 +1,7 @@
use clap::{Args, Parser, Subcommand}; use clap::{Args, Parser, Subcommand};
#[derive(Parser)] #[derive(Parser)]
#[command(author, version, about, long_about = None)] #[command(version, about, long_about = None)]
#[command(propagate_version = true)] #[command(propagate_version = true)]
struct Cli { struct Cli {
#[command(subcommand)] #[command(subcommand)]

View file

@ -1,7 +1,7 @@
use clap::Parser; use clap::Parser;
#[derive(Parser)] #[derive(Parser)]
#[command(author, version, about, long_about = None)] #[command(version, about, long_about = None)]
struct Cli { struct Cli {
#[arg(default_value_t = 2020)] #[arg(default_value_t = 2020)]
port: u16, port: u16,

View file

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

View file

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

View file

@ -3,7 +3,7 @@ use std::ops::RangeInclusive;
use clap::Parser; use clap::Parser;
#[derive(Parser)] #[derive(Parser)]
#[command(author, version, about, long_about = None)] #[command(version, about, long_about = None)]
struct Cli { struct Cli {
/// Network port to use /// Network port to use
#[arg(value_parser = port_in_range)] #[arg(value_parser = port_in_range)]

View file

@ -1,7 +1,7 @@
use clap::{Args, Parser}; use clap::{Args, Parser};
#[derive(Parser)] #[derive(Parser)]
#[command(author, version, about, long_about = None)] #[command(version, about, long_about = None)]
struct Cli { struct Cli {
#[command(flatten)] #[command(flatten)]
vers: Vers, vers: Vers,

View file

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

View file

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

View file

@ -8,7 +8,7 @@
//! //!
#![doc = include_str!("../../../examples/tutorial_derive/02_apps.md")] #![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 //! ```rust
#![doc = include_str!("../../../examples/tutorial_derive/02_crate.rs")] #![doc = include_str!("../../../examples/tutorial_derive/02_crate.rs")]