cargo_run/commands/
mod.rs1use clap::{Subcommand, ArgAction, ValueEnum};
6
7#[derive(Subcommand, Debug, Clone)]
9pub enum Commands {
10 #[command(about = "Run a script by name defined in Scripts.toml", visible_alias = "r")]
11 Run {
12 #[arg(value_name = "SCRIPT_NAME")]
13 script: Option<String>,
14 #[arg(short, long, value_name = "KEY=VALUE", action = ArgAction::Append)]
15 env: Vec<String>,
16 #[arg(long)]
18 dry_run: bool,
19 #[arg(short, long)]
21 quiet: bool,
22 #[arg(short = 'v', long)]
24 verbose: bool,
25 #[arg(long)]
27 no_metrics: bool,
28 #[arg(short, long)]
30 interactive: bool,
31 },
32 #[command(about = "Initialize a Scripts.toml file in the current directory")]
33 Init,
34 #[command(about = "Show all script names and descriptions defined in Scripts.toml")]
35 Show {
36 #[arg(short, long)]
38 quiet: bool,
39 #[arg(short = 'v', long)]
41 verbose: bool,
42 #[arg(short, long, value_name = "PATTERN")]
44 filter: Option<String>,
45 },
46 #[command(about = "Generate shell completion scripts")]
47 Completions {
48 #[arg(value_enum)]
50 shell: Shell,
51 },
52 #[command(about = "Validate Scripts.toml syntax, script references, and tool requirements")]
53 Validate {
54 #[arg(short, long)]
56 quiet: bool,
57 #[arg(short = 'v', long)]
59 verbose: bool,
60 },
61}
62
63#[derive(ValueEnum, Clone, Debug)]
65#[value(rename_all = "kebab-case")]
66pub enum Shell {
67 Bash,
68 Zsh,
69 Fish,
70 #[value(name = "power-shell")]
71 PowerShell,
72}
73
74pub mod init;
75pub mod script;
76pub mod show;
77pub mod completions;
78pub mod validate;