styling/doc
This commit is contained in:
parent
a8ff354a51
commit
72e9a5d40f
2 changed files with 7 additions and 6 deletions
|
|
@ -15,7 +15,7 @@ use std::{
|
||||||
};
|
};
|
||||||
|
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use console::style;
|
use console::{StyledObject, style};
|
||||||
use log::{info, trace};
|
use log::{info, trace};
|
||||||
|
|
||||||
use appstate::AppState;
|
use appstate::AppState;
|
||||||
|
|
@ -73,7 +73,7 @@ fn main() {
|
||||||
|
|
||||||
info!("continuing with state: {state:#?}");
|
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);
|
println!("{} is uploading: {fns_magenta}", *SHRUPL);
|
||||||
|
|
||||||
|
|
@ -91,14 +91,15 @@ fn main() {
|
||||||
|
|
||||||
if let ClientError::InvalidParameter(p) = e {
|
if let ClientError::InvalidParameter(p) = e {
|
||||||
match p {
|
match p {
|
||||||
// TODO Error 404: File not found
|
// Error 404 (File not found)
|
||||||
Parameter::FileID(fid) => {
|
Parameter::FileID(fid) => {
|
||||||
trace!("requeueing file {fid:?}");
|
trace!("requeueing file {fid:?}");
|
||||||
|
|
||||||
state.abort_upload();
|
state.abort_upload();
|
||||||
}
|
}
|
||||||
// TODO Error 404: Share not found
|
// Error 404 (Share not found)
|
||||||
Parameter::ShareID(sid) => {
|
Parameter::ShareID(sid) => {
|
||||||
|
// TODO ask
|
||||||
trace!("rebuilding share {sid:?}");
|
trace!("rebuilding share {sid:?}");
|
||||||
|
|
||||||
// rebuild share
|
// rebuild share
|
||||||
|
|
|
||||||
|
|
@ -38,9 +38,9 @@ pub fn prompt_continue() -> bool {
|
||||||
|
|
||||||
pub fn style_all<'t, F>(strs: &[&'t str], f: F) -> Vec<String>
|
pub fn style_all<'t, F>(strs: &[&'t str], f: F) -> Vec<String>
|
||||||
where
|
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 {}
|
pub enum Log {}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue