Rust: Restore compatibility with Debian Bookworm

This commit is contained in:
Dorota Czaplejewicz
2023-02-04 17:18:35 +00:00
parent d18f09823b
commit ffae36d259
4 changed files with 20 additions and 3 deletions

View File

@ -5,12 +5,28 @@ extern crate rs;
use rs::tests::check_layout_file;
fn main() -> () {
#[cfg(feature = "clap_v4")]
let matches = clap::Command::new("squeekboard-test-layout")
.about("Test keyboard layout for errors. Returns OK or an error message containing further information.")
.arg(
clap::Arg::new("INPUT")
.required(true)
.help("Yaml keyboard layout file to test")
)
.get_matches();
#[cfg(feature = "clap_v4")]
let m = matches.get_one::<String>("INPUT");
#[cfg(not(feature = "clap_v4"))]
let matches = clap_app!(test_layout =>
(name: "squeekboard-test-layout")
(about: "Test keyboard layout for errors. Returns OK or an error message containing further information.")
(@arg INPUT: +required "Yaml keyboard layout file to test")
).get_matches();
if check_layout_file(matches.value_of("INPUT").unwrap()) == () {
#[cfg(not(feature = "clap_v4"))]
let m = matches.value_of("INPUT");
if check_layout_file(m.unwrap()) == () {
println!("Test result: OK");
}
}