Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Clap Show the description written in the code

[package]
name = "show-description-from-code"
version = "0.1.0"
edition = "2021"
description = "This is the description in Cargo.toml"

[dependencies]
clap = { version = "4.5.7", features = ["derive"] }
use clap::Parser;

#[derive(Parser)]
#[command(about = "Hello from the code")]
struct Cli {}

fn main() {
    let _args = Cli::parse();
    println!("Use --help to show the description from the code");
}