mirror of
https://github.com/pinnacle-comp/pinnacle.git
synced 2024-12-26 21:58:10 +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
21
src/main.rs
21
src/main.rs
|
@ -28,12 +28,21 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||
}
|
||||
|
||||
let mut args = std::env::args().skip(1);
|
||||
if let Some("--winit") = args.next().as_deref() {
|
||||
tracing::info!("Starting winit backend");
|
||||
crate::backend::winit::run_winit()?;
|
||||
} else {
|
||||
tracing::info!("Starting udev backend");
|
||||
crate::backend::udev::run_udev()?;
|
||||
match args.next().as_deref() {
|
||||
Some("--winit") => {
|
||||
tracing::info!("Starting winit backend");
|
||||
crate::backend::winit::run_winit()?;
|
||||
}
|
||||
Some("--udev") => {
|
||||
tracing::info!("Starting udev backend");
|
||||
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(())
|
||||
|
|
Loading…
Reference in a new issue