feat(cli): add descriptions of args/flags
This commit is contained in:
@@ -5,11 +5,18 @@ use clap::Parser;
|
|||||||
#[derive(Parser, Debug)]
|
#[derive(Parser, Debug)]
|
||||||
#[command(version, about, long_about = None)]
|
#[command(version, about, long_about = None)]
|
||||||
pub struct Args {
|
pub struct Args {
|
||||||
|
/// word to define
|
||||||
pub word: String,
|
pub word: String,
|
||||||
|
|
||||||
|
/// language of the word
|
||||||
#[arg(short, long, default_value = "en")]
|
#[arg(short, long, default_value = "en")]
|
||||||
pub language: String,
|
pub language: String,
|
||||||
|
|
||||||
|
/// parts of speech to show
|
||||||
#[arg(short, long, default_values = constants::POSSIBLE_PARTS_OF_SPEECH)]
|
#[arg(short, long, default_values = constants::POSSIBLE_PARTS_OF_SPEECH)]
|
||||||
pub parts_of_speech: Vec<String>,
|
pub parts_of_speech: Vec<String>,
|
||||||
|
|
||||||
|
/// show examples for definitions
|
||||||
#[arg(short, long, action = clap::ArgAction::SetTrue)]
|
#[arg(short, long, action = clap::ArgAction::SetTrue)]
|
||||||
pub examples: bool,
|
pub examples: bool,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user