wip: main business logic

This commit is contained in:
Jörn-Michael Miehe 2025-06-05 01:44:39 +00:00
parent 666aae5a46
commit 7e9d553ef8
2 changed files with 10 additions and 8 deletions

View file

@ -5,7 +5,7 @@ use std::{
path::{Path, PathBuf},
};
use log::{debug, error, trace};
use log::{debug, trace};
use serde::{Deserialize, Serialize};
use super::{
@ -74,7 +74,7 @@ impl AppState {
let alias = args.get_alias();
let share = Share::create(http, &alias, args.get_share_request())
.inspect_err(|e| error!("could not create Share: {e}"))
.inspect_err(|e| debug!("could not create Share: {e}"))
.ok()?;
let files: VecDeque<_> = args.files.clone().into_iter().map(FileState::C).collect();

View file

@ -2,9 +2,12 @@ mod appstate;
mod cli;
mod sharry;
use std::sync::{
Arc,
atomic::{AtomicBool, Ordering},
use std::{
process::exit,
sync::{
Arc,
atomic::{AtomicBool, Ordering},
},
};
use clap::Parser;
@ -41,8 +44,7 @@ fn main() {
.or_else(|| AppState::from_args(&args, &agent))
.unwrap_or_else(|| {
error!("could not create new state from cli arguments: {args:?}");
std::process::exit(1);
exit(1);
});
info!("continuing with state: {state:?}");
@ -59,7 +61,7 @@ fn main() {
if !running.load(Ordering::SeqCst) {
info!("terminating ...");
std::process::exit(0);
exit(0);
}
}