use clap::{Args, Parser, Subcommand};
#[derive(Debug, Parser)]
#[command(
name = "rustuse",
version,
about = "RustUse command-line adoption helper.",
long_about = "rustuse helps find, inspect, and plan RustUse adoption. rustuse.toml is optional: Cargo-only and copy-only workflows do not require project state. Use rustuse init to opt into managed tracking."
)]
pub struct Cli {
#[arg(
short,
long,
global = true,
help = "Show extra detail about planned actions."
)]
pub verbose: bool,
#[arg(
short,
long,
global = true,
conflicts_with = "verbose",
help = "Only print essential output."
)]
pub quiet: bool,
#[arg(
long,
global = true,
help = "Print scaffold-friendly JSON-like output."
)]
pub json: bool,
#[command(subcommand)]
pub command: Commands,
}
#[derive(Debug, Subcommand)]
pub enum Commands {
Init(InitArgs),
Search(SearchArgs),
Info(NamedCommandArgs),
Add(AddArgs),
Copy(CopyArgs),
List,
Docs(DocsArgs),
Doctor,
}
#[derive(Debug, Args)]
pub struct InitArgs {
#[arg(long)]
pub copy_first: bool,
#[arg(long)]
pub cargo_first: bool,
#[arg(long)]
pub yes: bool,
#[arg(long)]
pub dry_run: bool,
#[arg(long, value_name = "PATH")]
pub copy_root: Option<String>,
#[arg(long, value_name = "PATH")]
pub test_root: Option<String>,
}
#[derive(Debug, Args)]
pub struct SearchArgs {
pub query: String,
}
#[derive(Debug, Args)]
pub struct NamedCommandArgs {
pub name: String,
}
#[derive(Debug, Args)]
pub struct CopyOptions {
#[arg(long)]
pub with_tests: bool,
}
#[derive(Debug, Args)]
pub struct AddArgs {
#[command(flatten)]
pub target: NamedCommandArgs,
#[arg(long)]
pub copy: bool,
#[command(flatten)]
pub copy_options: CopyOptions,
}
#[derive(Debug, Args)]
pub struct CopyArgs {
#[command(flatten)]
pub target: NamedCommandArgs,
#[command(flatten)]
pub options: CopyOptions,
#[arg(long)]
pub track: bool,
}
#[derive(Debug, Args)]
pub struct DocsArgs {
#[command(flatten)]
pub target: NamedCommandArgs,
#[arg(long, conflicts_with = "workspace")]
pub api: bool,
#[arg(long, conflicts_with = "api")]
pub workspace: bool,
}