Commit cfa66d81 authored by Mark Müller's avatar Mark Müller Committed by Dorota Czaplejewicz
Browse files

squeekboard-test-layout: add argument parsing and some more output

parent b6e67256
......@@ -4,6 +4,7 @@ version = "0.1.0"
[dependencies]
bitflags = "1.0.*"
clap = "2.32.*"
maplit = "1.0.*"
regex = "1.1.*"
serde = { version = "1.0.*", features = ["derive"] }
......
......@@ -12,6 +12,7 @@ Build-Depends:
libgtk-3-dev,
libcroco3-dev,
librust-bitflags-1-dev (>= 1.0),
librust-clap-2+default-dev (>= 2.32),
librust-gio+v2-44-dev,
librust-glib+v2-44-dev,
librust-glib-sys-dev,
......
#[macro_use]
extern crate clap;
extern crate rs;
use rs::tests::check_layout_file;
use std::env;
fn main() -> () {
check_layout_file(env::args().nth(1).expect("No argument given").as_str());
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()) == () {
println!("Test result: OK");
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment