feat: matcha binary skeleton with clap command surface
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
This commit is contained in:
4 files changed
+82
No files matched your search
+33
@@ -0,0 +1,33 @@
|
||||
use clap::{Parser, Subcommand};
|
||||
|
||||
#[derive(Parser)]
|
||||
#[command(name = "matcha", about = "green-tea CLI")]
|
||||
pub struct Cli {
|
||||
#[command(subcommand)]
|
||||
pub command: Command,
|
||||
}
|
||||
|
||||
#[derive(Subcommand)]
|
||||
pub enum Command {
|
||||
/// Scaffold a new project
|
||||
New {
|
||||
name: String,
|
||||
#[arg(long)]
|
||||
template_url: Option<String>,
|
||||
},
|
||||
/// Detect the runtime and run the project in watch mode
|
||||
Run,
|
||||
/// Generate a piece and auto-wire it into the module
|
||||
Create {
|
||||
#[arg(value_parser = ["module", "controller", "step"])]
|
||||
kind: String,
|
||||
name: String,
|
||||
#[arg(long)]
|
||||
check: bool,
|
||||
},
|
||||
/// Add a capability to a controller
|
||||
Add {
|
||||
#[arg(value_parser = ["sse", "stream", "buffer"])]
|
||||
capability: String,
|
||||
},
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
mod cli;
|
||||
|
||||
use clap::Parser;
|
||||
use cli::{Cli, Command};
|
||||
|
||||
fn main() {
|
||||
let cli = Cli::parse();
|
||||
match cli.command {
|
||||
Command::New { .. } => eprintln!("new: not yet implemented"),
|
||||
Command::Run => eprintln!("run: not yet implemented"),
|
||||
Command::Create { .. } => eprintln!("create: not yet implemented"),
|
||||
Command::Add { .. } => eprintln!("add: not yet implemented"),
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user