43 lines
1.3 KiB
Rust
43 lines
1.3 KiB
Rust
// This file is part of Deja-Vu.
|
|
//
|
|
// Deja-Vu is free software: you can redistribute it and/or modify it
|
|
// under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
//
|
|
// Deja-Vu is distributed in the hope that it will be useful, but
|
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
// See the GNU General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU General Public License
|
|
// along with Deja-Vu. If not, see <https://www.gnu.org/licenses/>.
|
|
//
|
|
use clap::Parser;
|
|
use color_eyre::Result;
|
|
|
|
use crate::app::App;
|
|
|
|
mod app;
|
|
|
|
#[tokio::main]
|
|
async fn main() -> Result<()> {
|
|
let mut msg = None;
|
|
if cfg!(windows) {
|
|
use check_elevation::is_elevated;
|
|
if !is_elevated().expect("Failed to get elevation status.") {
|
|
msg.replace("Administrator privedges required for Deja-Vu.");
|
|
}
|
|
};
|
|
if let Some(text) = msg {
|
|
println!("{text}");
|
|
} else {
|
|
core::errors::init()?;
|
|
core::logging::init()?;
|
|
|
|
let args = core::cli::Cli::parse();
|
|
let mut app = App::new(args.tick_rate, args.frame_rate)?;
|
|
app.run().await?;
|
|
}
|
|
Ok(())
|
|
}
|