Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasSaunders committed May 23, 2024
2 parents b56d696 + 9432a1a commit 6d912ed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "faa-nasr-data-processor"
version = "2.1.0"
version = "2.1.1"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
14 changes: 11 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ const ONE_SECOND:Duration = Duration::from_secs(1);
const VERSION: Option<&str> = option_env!("CARGO_PKG_VERSION");

fn main() {
fs::create_dir_all("./data").expect("Failed to create");

println!("FAA NASR Data Processor v{}", VERSION.unwrap_or("Unknown"));
fs::create_dir_all("./data").expect("Failed to create data folder");
fs::create_dir_all("./data/output").expect("Failed to create output folder");

main_menu();
}

Expand All @@ -25,8 +25,11 @@ fn main_menu() {
.build();

loop {
clear_console();
println!("FAA NASR Data Processor v{}", VERSION.unwrap_or("Unknown"));
match menu.prompt() {
Ok(tuple) => match tuple {
(0, 0) => std::process::exit(0), // Quit option
(1, 1) => airport::export_airport_list(),
(1, 2) => airport::generate_airport_changes(),
(1, 3) => preferential_route::generate_tec_route_changes(),
Expand All @@ -43,4 +46,9 @@ fn main_menu() {
}
}
}
}

fn clear_console() {
// Clear the screen and put the cursor at first row & first col of the screen
print!("\x1B[2J\x1B[1;1H");
}

0 comments on commit 6d912ed

Please sign in to comment.