angular-switcher 0.1.0

Switch between Angular component files (.ts, .html, styles, .spec.ts) from the Zed editor with a customizable keybinding.
Documentation
use clap::{ArgAction, Parser};
use std::path::PathBuf;

#[derive(Debug, Parser)]
#[command(
    name = "angular-switcher",
    about = "Switch between Angular component files (.ts, .html, styles, .spec.ts) from the Zed editor.",
    long_about = "Resolves the sibling file of an Angular component (the .ts, template, style \
                  or spec) and opens it in Zed via the `zed` CLI. Designed to be invoked from \
                  a Zed task bound to a keyboard shortcut. See the README for the recommended \
                  tasks.json and keymap.json snippets.",
    version
)]
#[allow(clippy::struct_excessive_bools)]
pub struct Cli {
    /// Path to the current file. Defaults to `$ZED_FILE`.
    pub file: Option<PathBuf>,

    /// Switch directly to a specific target: ts, html, style, spec.
    #[arg(short = 't', long, value_name = "TARGET")]
    pub to: Option<String>,

    /// Cycle to the next sibling. Default behavior when --to is omitted.
    #[arg(short = 'c', long, action = ArgAction::SetTrue)]
    pub cycle: bool,

    /// Cycle backwards instead of forwards.
    #[arg(short = 'r', long, action = ArgAction::SetTrue)]
    pub reverse: bool,

    /// Print the resolved sibling path to stdout instead of launching Zed.
    #[arg(long, action = ArgAction::SetTrue)]
    pub print: bool,

    /// Skip the `zed` invocation but still exit 0 on success (for scripting).
    #[arg(long, action = ArgAction::SetTrue)]
    pub no_launch: bool,

    /// Override the config file location.
    #[arg(long, value_name = "PATH")]
    pub config: Option<PathBuf>,

    /// Log resolution steps to stderr.
    #[arg(short = 'v', long, action = ArgAction::SetTrue)]
    pub verbose: bool,
}