parent
4fbf68563a
commit
67bca6336c
15
src/main.rs
15
src/main.rs
|
@ -1,4 +1,4 @@
|
||||||
use std::process::exit;
|
use std::{io::ErrorKind, process::exit};
|
||||||
|
|
||||||
use anyhow::anyhow;
|
use anyhow::anyhow;
|
||||||
|
|
||||||
|
@ -25,21 +25,16 @@ fn become_wm<C: Connection>(conn: &C, screen: &Screen) -> anyhow::Result<()> {
|
||||||
res.map_err(|e| anyhow!(e))
|
res.map_err(|e| anyhow!(e))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn handle_args() {
|
fn main() -> anyhow::Result<()> {
|
||||||
let mut args = std::env::args().skip(1);
|
let mut args = std::env::args().skip(1);
|
||||||
if let Some(arg) = args.next() {
|
if let Some(arg) = args.next() {
|
||||||
if arg != "-v" {
|
if arg != "-v" {
|
||||||
eprintln!("usage: rswm [-v]");
|
return Err(anyhow!("usage: rswm [-v]"));
|
||||||
exit(1);
|
|
||||||
} else {
|
} else {
|
||||||
println!("rswm-{}", env!("CARGO_PKG_VERSION"));
|
println!(env!("CARGO_PKG_VERSION")); // TODO: test this
|
||||||
exit(0);
|
return Ok(());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
fn main() -> anyhow::Result<()> {
|
|
||||||
handle_args();
|
|
||||||
|
|
||||||
// TODO: Investigate LC_CTYPE and Locale stuff from dwm
|
// TODO: Investigate LC_CTYPE and Locale stuff from dwm
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue