1use clap::{Parser, ValueEnum};
2
3#[derive(Parser)]
4#[command(name = "try-rs")]
5#[command(about = format!("🦀 try-rs {} 🦀\nA blazing fast, Rust-based workspace manager for your temporary experiments.", env!("CARGO_PKG_VERSION")), long_about = None)]
6#[command(version = env!("CARGO_PKG_VERSION"))]
7pub struct Cli {
8 #[arg(value_name = "NAME_OR_URL")]
10 pub name_or_url: Option<String>,
11
12 #[arg(value_name = "DESTINATION")]
14 pub destination: Option<String>,
15
16 #[arg(long)]
18 pub setup: Option<Shell>,
19
20 #[arg(long)]
22 pub setup_stdout: Option<Shell>,
23
24 #[arg(long)]
26 pub setup_clear: bool,
27
28 #[arg(long)]
30 pub completions: Option<Shell>,
31
32 #[arg(short, long)]
34 pub shallow_clone: bool,
35
36 #[arg(short = 'w', long = "worktree", value_name = "WORKTREE_NAME")]
38 pub worktree: Option<String>,
39
40 #[arg(long)]
42 pub inline_picker: bool,
43
44 #[arg(long, value_name = "LINES", requires = "inline_picker")]
46 pub inline_height: Option<u16>,
47
48 #[arg(long, overrides_with = "hide_disk", action = clap::ArgAction::SetTrue)]
50 pub show_disk: bool,
51
52 #[arg(
54 long,
55 overrides_with = "show_disk",
56 action = clap::ArgAction::SetFalse,
57 default_value_t = true
58 )]
59 pub hide_disk: bool,
60
61 #[arg(long, overrides_with = "hide_preview", action = clap::ArgAction::SetTrue)]
63 pub show_preview: bool,
64
65 #[arg(
67 long,
68 overrides_with = "show_preview",
69 action = clap::ArgAction::SetFalse,
70 default_value_t = true
71 )]
72 pub hide_preview: bool,
73
74 #[arg(long, overrides_with = "hide_legend", action = clap::ArgAction::SetTrue)]
76 pub show_legend: bool,
77
78 #[arg(
80 long,
81 overrides_with = "show_legend",
82 action = clap::ArgAction::SetFalse,
83 default_value_t = true
84 )]
85 pub hide_legend: bool,
86
87 #[arg(long, overrides_with = "hide_right_panel", action = clap::ArgAction::SetTrue)]
89 pub show_right_panel: bool,
90
91 #[arg(
93 long,
94 overrides_with = "show_right_panel",
95 action = clap::ArgAction::SetFalse,
96 default_value_t = true
97 )]
98 pub hide_right_panel: bool,
99}
100
101#[derive(ValueEnum, Clone, Copy, PartialEq, Eq, Debug, Hash)]
102pub enum Shell {
103 Fish,
104 Zsh,
105 Bash,
106 #[allow(clippy::enum_variant_names)]
107 NuShell,
108 #[allow(clippy::enum_variant_names)]
109 PowerShell,
110}