Compare commits

...

3 Commits

Author SHA1 Message Date
Mark Müller
3af10285b7 squeekboard-test-layout: correct dependencies and version for clap argument parsing 2019-12-13 21:37:50 +01:00
Mark Müller
53997abc46 added librust-clap-dev to debian/control 2019-12-08 21:14:56 +01:00
Mark Müller
34765be22e squeekboard-test-layout: add argument parsing and some more output 2019-12-08 18:29:54 +01:00
3 changed files with 12 additions and 2 deletions

View File

@@ -4,6 +4,7 @@ version = "0.1.0"
[dependencies] [dependencies]
bitflags = "1.0.*" bitflags = "1.0.*"
clap = "2.32.*"
maplit = "1.0.*" maplit = "1.0.*"
regex = "1.1.*" regex = "1.1.*"
serde = { version = "1.0.*", features = ["derive"] } serde = { version = "1.0.*", features = ["derive"] }

1
debian/control vendored
View File

@@ -12,6 +12,7 @@ Build-Depends:
libgtk-3-dev, libgtk-3-dev,
libcroco3-dev, libcroco3-dev,
librust-bitflags-1-dev (>= 1.0), librust-bitflags-1-dev (>= 1.0),
librust-clap-2+default-dev (>= 2.32),
librust-gio+v2-44-dev, librust-gio+v2-44-dev,
librust-glib+v2-44-dev, librust-glib+v2-44-dev,
librust-glib-sys-dev, librust-glib-sys-dev,

View File

@@ -1,8 +1,16 @@
#[macro_use]
extern crate clap;
extern crate rs; extern crate rs;
use rs::tests::check_layout_file; use rs::tests::check_layout_file;
use std::env;
fn main() -> () { 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");
}
} }