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)]
#[command(author, version, about, long_about = None)]
#[command(version, about, long_about = None)]
struct ExampleDeriveArgs {
#[arg(long)]
manifest_path: Option<std::path::PathBuf>,

View file

@ -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)]

View file

@ -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,

View file

@ -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.

View file

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

View file

@ -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<String>,

View file

@ -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)]

View file

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

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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<String>,

View file

@ -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<String>,

View file

@ -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<String>,
}

View file

@ -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<String>,
}

View file

@ -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)]

View file

@ -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)]

View file

@ -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,

View file

@ -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)]

View file

@ -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..))]

View file

@ -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)]

View file

@ -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,

View file

@ -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")]

View file

@ -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,

View file

@ -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")]