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 completions: Option<Shell>,
27
28 #[arg(short, long)]
30 pub shallow_clone: bool,
31
32 #[arg(short = 'w', long = "worktree", value_name = "WORKTREE_NAME")]
34 pub worktree: Option<String>,
35
36 #[arg(long)]
38 pub inline_picker: bool,
39
40 #[arg(long, value_name = "LINES", requires = "inline_picker")]
42 pub inline_height: Option<u16>,
43
44 #[arg(long, overrides_with = "hide_disk", action = clap::ArgAction::SetTrue)]
46 pub show_disk: bool,
47
48 #[arg(
50 long,
51 overrides_with = "show_disk",
52 action = clap::ArgAction::SetFalse,
53 default_value_t = true
54 )]
55 pub hide_disk: bool,
56
57 #[arg(long, overrides_with = "hide_preview", action = clap::ArgAction::SetTrue)]
59 pub show_preview: bool,
60
61 #[arg(
63 long,
64 overrides_with = "show_preview",
65 action = clap::ArgAction::SetFalse,
66 default_value_t = true
67 )]
68 pub hide_preview: bool,
69
70 #[arg(long, overrides_with = "hide_legend", action = clap::ArgAction::SetTrue)]
72 pub show_legend: bool,
73
74 #[arg(
76 long,
77 overrides_with = "show_legend",
78 action = clap::ArgAction::SetFalse,
79 default_value_t = true
80 )]
81 pub hide_legend: bool,
82
83 #[arg(long, overrides_with = "hide_right_panel", action = clap::ArgAction::SetTrue)]
85 pub show_right_panel: bool,
86
87 #[arg(
89 long,
90 overrides_with = "show_right_panel",
91 action = clap::ArgAction::SetFalse,
92 default_value_t = true
93 )]
94 pub hide_right_panel: bool,
95}
96
97#[derive(ValueEnum, Clone, Copy, PartialEq, Eq, Debug, Hash)]
98pub enum Shell {
99 Fish,
100 Zsh,
101 Bash,
102 #[allow(clippy::enum_variant_names)]
103 NuShell,
104 #[allow(clippy::enum_variant_names)]
105 PowerShell,
106}