From 6ca3e6c9dd06c02ef2341f8df86795955f366066 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= <40151420+ldericher@users.noreply.github.com> Date: Sun, 15 Jun 2025 00:56:58 +0000 Subject: [PATCH] [wip] documentation - added more notes - minor cleanup --- notes.md | 1 + src/file/checked.rs | 6 +++--- src/main.rs | 12 ++++++------ 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/notes.md b/notes.md index b04b3ad..cec706c 100644 --- a/notes.md +++ b/notes.md @@ -50,6 +50,7 @@ - "continue" and "new" flags to avoid user interaction - "quiet" flag to disable output entirely - "verbose" flag to adjust RUST_LOG for `shrupl` crate + - some switch to change log to "pretty-print" - client error rework - current variants are too "low level" diff --git a/src/file/checked.rs b/src/file/checked.rs index 6bff36c..c6957ff 100644 --- a/src/file/checked.rs +++ b/src/file/checked.rs @@ -27,8 +27,8 @@ impl Checked { /// /// # Errors /// - /// - calls `fs::metadata(path)` or `fs::canonicalize` - /// - path does not correspond to a regular file + /// - from `fs::metadata(path)` or `fs::canonicalize` + /// - given path does not correspond to a regular file pub fn new(value: impl AsRef) -> io::Result { let meta = fs::metadata(&value)?; if meta.is_file() { @@ -52,7 +52,7 @@ impl Checked { /// /// # Errors /// - /// - + /// TODO documentation after `ClientError` rework pub fn start_upload( self, client: &impl sharry::Client, diff --git a/src/main.rs b/src/main.rs index ab063cd..249977e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -73,12 +73,6 @@ fn print_error(e: &ClientError) { fn main() { env_logger::init(); - println!( - "{} to {}!", - style("Welcome").magenta().bold(), - style("ShrUpl").yellow().bold(), - ); - let check_ctrlc = { let stop = Arc::new(AtomicBool::new(false)); let stop_ctrlc = stop.clone(); @@ -99,6 +93,12 @@ fn main() { let args = Cli::parse(); info!("args: {args:#?}"); + println!( + "{} to {}!", + style("Welcome").magenta().bold(), + style("ShrUpl").yellow().bold(), + ); + let mut state = AppState::try_resume(&args) .and_then(|state| prompt_continue().then_some(state)) .unwrap_or_else(|| {