Small fixes

This commit is contained in:
Luke
2020-04-16 20:16:13 +12:00
parent e0402d99e7
commit 0a88b5b20a
3 changed files with 14 additions and 13 deletions

2
Cargo.lock generated
View File

@@ -163,7 +163,7 @@ checksum = "cabe4fa914dec5870285fa7f71f602645da47c486e68486d2b4ceb4a343e90ac"
[[package]] [[package]]
name = "rog-core" name = "rog-core"
version = "0.2.0" version = "0.3.0"
dependencies = [ dependencies = [
"dbus", "dbus",
"gumdrop", "gumdrop",

View File

@@ -81,15 +81,12 @@ impl FromStr for Direction {
} }
#[derive(Debug, PartialEq, Options)] #[derive(Debug, PartialEq, Options)]
pub(crate) struct Breathe { pub(crate) struct TwoColourSpeed {
#[options(help = "print help message")] #[options(help = "print help message")]
help: bool, help: bool,
#[options(no_long, help = "set the first colour, must be hex string e.g, ff00ff")] #[options(no_long, meta = "HEX", help = "set the first RGB value e.g, ff00ff")]
colour: Colour, colour: Colour,
#[options( #[options(no_long, meta = "HEX", help = "set the second RGB value e.g, ff00ff")]
no_long,
help = "set the second colour, must be hex string e.g, ff00ff"
)]
colour2: Colour, colour2: Colour,
#[options(no_long, help = "set the speed: low, med, high")] #[options(no_long, help = "set the speed: low, med, high")]
speed: Speed, speed: Speed,
@@ -99,7 +96,7 @@ pub(crate) struct Breathe {
pub(crate) struct SingleSpeed { pub(crate) struct SingleSpeed {
#[options(help = "print help message")] #[options(help = "print help message")]
help: bool, help: bool,
#[options(no_long, help = "set the speed: low, med, high")] #[options(no_long, meta = "WORD", help = "set the speed: low, med, high")]
speed: Speed, speed: Speed,
} }
@@ -107,7 +104,7 @@ pub(crate) struct SingleSpeed {
pub(crate) struct SingleColour { pub(crate) struct SingleColour {
#[options(help = "print help message")] #[options(help = "print help message")]
help: bool, help: bool,
#[options(no_long, help = "set the colour, must be hex string e.g, ff00ff")] #[options(no_long, meta = "HEX", help = "set the RGB value e.g, ff00ff")]
colour: Colour, colour: Colour,
} }
@@ -115,7 +112,11 @@ pub(crate) struct SingleColour {
pub(crate) struct SingleSpeedDirection { pub(crate) struct SingleSpeedDirection {
#[options(help = "print help message")] #[options(help = "print help message")]
help: bool, help: bool,
#[options(no_long, help = "set the direction: up, down, left, right")] #[options(
no_long,
meta = "DIR",
help = "set the direction: up, down, left, right"
)]
direction: Direction, direction: Direction,
#[options(no_long, help = "set the speed: low, med, high")] #[options(no_long, help = "set the speed: low, med, high")]
speed: Speed, speed: Speed,
@@ -125,7 +126,7 @@ pub(crate) struct SingleSpeedDirection {
pub(crate) struct SingleColourSpeed { pub(crate) struct SingleColourSpeed {
#[options(help = "print help message")] #[options(help = "print help message")]
help: bool, help: bool,
#[options(no_long, help = "set the colour, must be hex string e.g, ff00ff")] #[options(no_long, meta = "HEX", help = "set the RGB value e.g, ff00ff")]
colour: Colour, colour: Colour,
#[options(no_long, help = "set the speed: low, med, high")] #[options(no_long, help = "set the speed: low, med, high")]
speed: Speed, speed: Speed,
@@ -139,7 +140,7 @@ pub(crate) enum SetAuraBuiltin {
#[options(help = "set a single static colour")] #[options(help = "set a single static colour")]
Stable(SingleColour), Stable(SingleColour),
#[options(help = "pulse between one or two colours")] #[options(help = "pulse between one or two colours")]
Breathe(Breathe), Breathe(TwoColourSpeed),
#[options(help = "cycle through all colours")] #[options(help = "cycle through all colours")]
Cycle(SingleSpeed), Cycle(SingleSpeed),
#[options(help = "rainbow cycling in one of four directions")] #[options(help = "rainbow cycling in one of four directions")]

View File

@@ -21,7 +21,7 @@ struct CLIStart {
daemon: bool, daemon: bool,
#[options(help = "client mode")] #[options(help = "client mode")]
client: bool, client: bool,
#[options(help = "<off, low, med, high>")] #[options(meta = "VAL", help = "<off, low, med, high>")]
bright: Option<LedBrightness>, bright: Option<LedBrightness>,
#[options(command)] #[options(command)]
command: Option<Command>, command: Option<Command>,