robin/cli/commands.rs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
use clap::{Parser, Subcommand};
#[derive(Parser)]
#[command(author, version, about)]
pub struct Cli {
#[command(subcommand)]
pub command: Option<Commands>,
/// List all available commands
#[arg(short, long)]
pub list: bool,
/// Interactive mode
#[arg(short, long)]
pub interactive: bool,
/// Send system notification when command completes
#[arg(long)]
pub notify: bool,
}
#[derive(Subcommand)]
pub enum Commands {
/// Initialize a new .robin.json file
Init {
/// Template to use (android, ios, flutter, rails, node, python, rust, go)
#[arg(long)]
template: Option<String>,
},
/// Add a new command
Add {
/// Command name
name: String,
/// Command script
script: String,
},
/// Check development environment setup
Doctor,
/// Update development tools to their latest versions
DoctorUpdate,
/// Run a script
#[command(external_subcommand)]
Run(Vec<String>),
}