main.rs: testing verbose output
Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
This commit is contained in:
15
src/main.rs
15
src/main.rs
@@ -1,3 +1,9 @@
|
|||||||
|
/* advotracker infrastructure.
|
||||||
|
*
|
||||||
|
* Copyright 2019 Ralf Zerres <ralf.zerres@networkx.de>
|
||||||
|
* SPDX-License-Identifier: 0BSD
|
||||||
|
*/
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate clap;
|
extern crate clap;
|
||||||
extern crate locales;
|
extern crate locales;
|
||||||
@@ -37,6 +43,15 @@ fn main() {
|
|||||||
3 | _ => println!("Don't be crazy"),
|
3 | _ => println!("Don't be crazy"),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// You can handle information about subcommands by requesting their matches by name
|
||||||
|
// (as below), requesting just the name used, or both at the same time
|
||||||
|
if let Some(matches) = matches.subcommand_matches("test") {
|
||||||
|
if matches.is_present("debug") {
|
||||||
|
println!("Printing debug info...");
|
||||||
|
} else {
|
||||||
|
println!("Printing normally...");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Starting the program logic
|
// Starting the program logic
|
||||||
let res = t!("main.start", lang);
|
let res = t!("main.start", lang);
|
||||||
|
|||||||
Reference in New Issue
Block a user