mirror of
https://github.com/pinnacle-comp/pinnacle.git
synced 2025-01-27 19:58:08 +01:00
Add arguments for both winit and udev backends
This commit is contained in:
parent
07d3c3c7fc
commit
e0a858214c
1 changed files with 15 additions and 6 deletions
13
src/main.rs
13
src/main.rs
|
@ -28,13 +28,22 @@ fn main() -> Result<(), Box<dyn Error>> {
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut args = std::env::args().skip(1);
|
let mut args = std::env::args().skip(1);
|
||||||
if let Some("--winit") = args.next().as_deref() {
|
match args.next().as_deref() {
|
||||||
|
Some("--winit") => {
|
||||||
tracing::info!("Starting winit backend");
|
tracing::info!("Starting winit backend");
|
||||||
crate::backend::winit::run_winit()?;
|
crate::backend::winit::run_winit()?;
|
||||||
} else {
|
}
|
||||||
|
Some("--udev") => {
|
||||||
tracing::info!("Starting udev backend");
|
tracing::info!("Starting udev backend");
|
||||||
crate::backend::udev::run_udev()?;
|
crate::backend::udev::run_udev()?;
|
||||||
}
|
}
|
||||||
|
Some(arg) => tracing::error!("Unknown argument {}", arg),
|
||||||
|
None => {
|
||||||
|
println!(
|
||||||
|
"Specify a backend:\n\t--udev to launch Pinnacle in a tty, or\n\t--winit to launch Pinnacle as an ordinary window in your graphical environment."
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue