-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcli.rs
More file actions
41 lines (36 loc) · 907 Bytes
/
Copy pathcli.rs
File metadata and controls
41 lines (36 loc) · 907 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
use clap::{Parser, Subcommand};
#[derive(Parser, Debug)]
#[command(
author,
version,
about,
long_about = None,
after_help = "Examples:\n xfetch\n xfetch --config ~/.config/xfetch/config.jsonc\n xfetch --gen-config\n xfetch plugin install ./plugins/animate-logo\n xfetch plugin list\n xfetch plugin remove animate-logo"
)]
pub struct Cli {
#[command(subcommand)]
pub command: Option<Commands>,
#[arg(short, long, global = true)]
pub config: Option<String>,
#[arg(long, global = true)]
pub gen_config: bool,
}
#[derive(Subcommand, Debug)]
pub enum Commands {
Plugin {
#[command(subcommand)]
action: PluginCommands,
},
}
#[derive(Subcommand, Debug)]
pub enum PluginCommands {
Install {
path: String,
#[arg(long, short)]
repo: Option<String>,
},
List,
Remove {
name: String,
},
}