-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcommonargs.rs
48 lines (39 loc) · 1.13 KB
/
commonargs.rs
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
42
43
44
45
46
47
48
use std::path::PathBuf;
use cherryrgb::{self, LightingMode, OwnRGB8, Speed};
use clap::{Parser, Subcommand};
#[derive(Parser, Debug)]
pub struct AnimationArgs {
/// Set LED mode
#[arg(value_enum)]
pub mode: LightingMode,
/// Set speed
#[arg(value_enum)]
pub speed: Speed,
/// Color (e.g ff00ff)
pub color: Option<OwnRGB8>,
/// Enable rainbow colors
#[arg(short, long)]
pub rainbow: bool,
}
#[derive(Parser, Debug)]
pub struct CustomColorOptions {
/// One or more RGB color specs (6-digit hex numbers)
pub colors: Vec<OwnRGB8>,
}
#[derive(Parser, Debug)]
pub struct ColorProfileFileOptions {
/// If enabled, modifies existing color profile
#[arg(short, long = "keep-existing-colors")]
pub keep_existing: bool,
/// A json encoded file, specifying key colors
pub file_path: PathBuf,
}
#[derive(Subcommand, Debug)]
pub enum CliCommand {
/// Configure RGB keyboard illumination
Animation(AnimationArgs),
/// Configure custom RGB colors
CustomColors(CustomColorOptions),
/// Configure custom RGB colors from file
ColorProfileFile(ColorProfileFileOptions),
}