mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-01-19 08:57:55 +00:00
use long names
This commit is contained in:
parent
3a8ebca75e
commit
0eb1534e42
2 changed files with 5 additions and 5 deletions
|
@ -42,20 +42,20 @@ pub fn build_cli() -> App<'static> {
|
||||||
.help("Prints current brightness value"),
|
.help("Prints current brightness value"),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("zer")
|
Arg::with_name("zero")
|
||||||
.short('z')
|
.short('z')
|
||||||
.long("zero")
|
.long("zero")
|
||||||
.help("Sets brightness to lowest value"),
|
.help("Sets brightness to lowest value"),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("ful")
|
Arg::with_name("full")
|
||||||
.short('f')
|
.short('f')
|
||||||
.long("full")
|
.long("full")
|
||||||
.help("Sets brightness to highest value"),
|
.help("Sets brightness to highest value"),
|
||||||
)
|
)
|
||||||
.group(
|
.group(
|
||||||
ArgGroup::with_name("brightness_control")
|
ArgGroup::with_name("brightness_control")
|
||||||
.args(&["set", "inc", "dec", "get", "zer", "ful"]),
|
.args(&["set", "inc", "dec", "get", "zero", "full"]),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("list")
|
Arg::with_name("list")
|
||||||
|
|
|
@ -42,9 +42,9 @@ fn main() {
|
||||||
controller.set_brightness(new_value.max(0));
|
controller.set_brightness(new_value.max(0));
|
||||||
} else if matches.is_present("get") {
|
} else if matches.is_present("get") {
|
||||||
println!("{}", controller.get_brightness());
|
println!("{}", controller.get_brightness());
|
||||||
} else if matches.is_present("zer") {
|
} else if matches.is_present("zero") {
|
||||||
controller.set_brightness(0);
|
controller.set_brightness(0);
|
||||||
} else if matches.is_present("ful") {
|
} else if matches.is_present("full") {
|
||||||
controller.set_brightness(controller.get_max_brightness());
|
controller.set_brightness(controller.get_max_brightness());
|
||||||
} else {
|
} else {
|
||||||
build_cli().print_long_help().unwrap();
|
build_cli().print_long_help().unwrap();
|
||||||
|
|
Loading…
Reference in a new issue