use long names

This commit is contained in:
crapStone 2022-07-16 01:17:20 +02:00
parent 3a8ebca75e
commit 0eb1534e42
No known key found for this signature in database
GPG key ID: 4CAA9E39EEDEB1F0
2 changed files with 5 additions and 5 deletions

View file

@ -42,20 +42,20 @@ pub fn build_cli() -> App<'static> {
.help("Prints current brightness value"),
)
.arg(
Arg::with_name("zer")
Arg::with_name("zero")
.short('z')
.long("zero")
.help("Sets brightness to lowest value"),
)
.arg(
Arg::with_name("ful")
Arg::with_name("full")
.short('f')
.long("full")
.help("Sets brightness to highest value"),
)
.group(
ArgGroup::with_name("brightness_control")
.args(&["set", "inc", "dec", "get", "zer", "ful"]),
.args(&["set", "inc", "dec", "get", "zero", "full"]),
)
.arg(
Arg::with_name("list")

View file

@ -42,9 +42,9 @@ fn main() {
controller.set_brightness(new_value.max(0));
} else if matches.is_present("get") {
println!("{}", controller.get_brightness());
} else if matches.is_present("zer") {
} else if matches.is_present("zero") {
controller.set_brightness(0);
} else if matches.is_present("ful") {
} else if matches.is_present("full") {
controller.set_brightness(controller.get_max_brightness());
} else {
build_cli().print_long_help().unwrap();