styling/doc

This commit is contained in:
Jörn-Michael Miehe 2025-06-24 01:28:09 +00:00
parent a8ff354a51
commit 72e9a5d40f
2 changed files with 7 additions and 6 deletions

View file

@ -15,7 +15,7 @@ use std::{
};
use clap::Parser;
use console::style;
use console::{StyledObject, style};
use log::{info, trace};
use appstate::AppState;
@ -73,7 +73,7 @@ fn main() {
info!("continuing with state: {state:#?}");
let fns_magenta = output::style_all(&args.file_names(), |s| style(s).magenta()).join(", ");
let fns_magenta = output::style_all(&args.file_names(), StyledObject::magenta).join(", ");
println!("{} is uploading: {fns_magenta}", *SHRUPL);
@ -91,14 +91,15 @@ fn main() {
if let ClientError::InvalidParameter(p) = e {
match p {
// TODO Error 404: File not found
// Error 404 (File not found)
Parameter::FileID(fid) => {
trace!("requeueing file {fid:?}");
state.abort_upload();
}
// TODO Error 404: Share not found
// Error 404 (Share not found)
Parameter::ShareID(sid) => {
// TODO ask
trace!("rebuilding share {sid:?}");
// rebuild share

View file

@ -38,9 +38,9 @@ pub fn prompt_continue() -> bool {
pub fn style_all<'t, F>(strs: &[&'t str], f: F) -> Vec<String>
where
F: Fn(&'t str) -> StyledObject<&'t str>,
F: Fn(StyledObject<&'t str>) -> StyledObject<&'t str>,
{
strs.iter().map(|&s| f(s).to_string()).collect()
strs.iter().map(|&s| f(style(s)).to_string()).collect()
}
pub enum Log {}