Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e383ce817e | ||
|
|
3e045f7a80 | ||
|
|
cce7f6266d |
6
Makefile
6
Makefile
@@ -2,9 +2,9 @@ NAME = "globalenter"
|
|||||||
|
|
||||||
build b:
|
build b:
|
||||||
@echo "building x86_64 Linux"
|
@echo "building x86_64 Linux"
|
||||||
RUSTFLAGS=-Awarnings cargo build --release --target x86_64-unknown-linux-gnu -q --frozen
|
RUSTFLAGS=-Awarnings cargo build --release --target x86_64-unknown-linux-gnu -q
|
||||||
@echo "building x86_64 Windows"
|
@echo "building x86_64 Windows"
|
||||||
RUSTFLAGS=-Awarnings cargo build --release --target x86_64-pc-windows-gnu -q --frozen
|
RUSTFLAGS=-Awarnings cargo build --release --target x86_64-pc-windows-gnu -q
|
||||||
mkdir -p bin
|
mkdir -p bin
|
||||||
cp target/x86_64-unknown-linux-gnu/release/$(NAME) bin/$(NAME)
|
cp target/x86_64-unknown-linux-gnu/release/$(NAME) bin/$(NAME)
|
||||||
chmod +x bin/$(NAME)
|
chmod +x bin/$(NAME)
|
||||||
@@ -14,4 +14,4 @@ build b:
|
|||||||
|
|
||||||
clean c:
|
clean c:
|
||||||
cargo clean
|
cargo clean
|
||||||
rm -rf bin
|
rm -rf bin
|
||||||
|
|||||||
19
src/main.rs
19
src/main.rs
@@ -25,19 +25,18 @@ const CHARLOTTE: u32 = 14321;
|
|||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() {
|
async fn main() {
|
||||||
let mut location_id: u32 = CHARLOTTE;
|
let mut location_id: u32 = CHARLOTTE;
|
||||||
let mut buf = [0, 0, 0, 0];
|
let mut buf = [0; 32];
|
||||||
|
|
||||||
println!("Enter a location id to override the default (Charlotte, NC): ");
|
println!(
|
||||||
let loc_input = io::stdin().read(&mut buf).await;
|
"Enter a location id to override the default (Charlotte, NC, {:?}): ",
|
||||||
|
CHARLOTTE
|
||||||
|
);
|
||||||
|
io::stdin().read(&mut buf).await.unwrap();
|
||||||
|
|
||||||
if loc_input.unwrap() > 1 {
|
let loc = String::from_utf8(buf.to_vec()).unwrap().trim().parse();
|
||||||
location_id = String::from_utf8(buf.to_vec())
|
if loc.is_ok() {
|
||||||
.unwrap()
|
location_id = loc.unwrap();
|
||||||
.trim()
|
|
||||||
.parse()
|
|
||||||
.unwrap();
|
|
||||||
}
|
}
|
||||||
eprintln!("Using default location (Charlotte, NC): {}", location_id);
|
|
||||||
|
|
||||||
println!("Looking for appointments at location id: {}", location_id);
|
println!("Looking for appointments at location id: {}", location_id);
|
||||||
loop {
|
loop {
|
||||||
|
|||||||
Reference in New Issue
Block a user