1use clap::{ArgAction, Parser};
2use std::path::PathBuf;
3
4#[derive(Debug, Parser)]
5#[command(
6 name = "angular-switcher",
7 about = "Switch between Angular component files (.ts, .html, styles, .spec.ts) from the Zed editor.",
8 long_about = "Resolves the sibling file of an Angular component (the .ts, template, style \
9 or spec) and opens it in Zed via the `zed` CLI. Designed to be invoked from \
10 a Zed task bound to a keyboard shortcut. See the README for the recommended \
11 tasks.json and keymap.json snippets.",
12 version
13)]
14#[allow(clippy::struct_excessive_bools)]
15pub struct Cli {
16 pub file: Option<PathBuf>,
18
19 #[arg(short = 't', long, value_name = "TARGET")]
21 pub to: Option<String>,
22
23 #[arg(short = 'c', long, action = ArgAction::SetTrue)]
25 pub cycle: bool,
26
27 #[arg(short = 'r', long, action = ArgAction::SetTrue)]
29 pub reverse: bool,
30
31 #[arg(long, action = ArgAction::SetTrue)]
33 pub print: bool,
34
35 #[arg(long, action = ArgAction::SetTrue)]
37 pub no_launch: bool,
38
39 #[arg(long, value_name = "PATH")]
41 pub config: Option<PathBuf>,
42
43 #[arg(short = 'v', long, action = ArgAction::SetTrue)]
45 pub verbose: bool,
46}