[wip] documentation
- added more notes - minor cleanup
This commit is contained in:
parent
4bf18631d4
commit
6ca3e6c9dd
3 changed files with 10 additions and 9 deletions
1
notes.md
1
notes.md
|
|
@ -50,6 +50,7 @@
|
||||||
- "continue" and "new" flags to avoid user interaction
|
- "continue" and "new" flags to avoid user interaction
|
||||||
- "quiet" flag to disable output entirely
|
- "quiet" flag to disable output entirely
|
||||||
- "verbose" flag to adjust RUST_LOG for `shrupl` crate
|
- "verbose" flag to adjust RUST_LOG for `shrupl` crate
|
||||||
|
- some switch to change log to "pretty-print"
|
||||||
|
|
||||||
- client error rework
|
- client error rework
|
||||||
- current variants are too "low level"
|
- current variants are too "low level"
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,8 @@ impl Checked {
|
||||||
///
|
///
|
||||||
/// # Errors
|
/// # Errors
|
||||||
///
|
///
|
||||||
/// - calls `fs::metadata(path)` or `fs::canonicalize`
|
/// - from `fs::metadata(path)` or `fs::canonicalize`
|
||||||
/// - path does not correspond to a regular file
|
/// - given path does not correspond to a regular file
|
||||||
pub fn new(value: impl AsRef<Path>) -> io::Result<Self> {
|
pub fn new(value: impl AsRef<Path>) -> io::Result<Self> {
|
||||||
let meta = fs::metadata(&value)?;
|
let meta = fs::metadata(&value)?;
|
||||||
if meta.is_file() {
|
if meta.is_file() {
|
||||||
|
|
@ -52,7 +52,7 @@ impl Checked {
|
||||||
///
|
///
|
||||||
/// # Errors
|
/// # Errors
|
||||||
///
|
///
|
||||||
/// -
|
/// TODO documentation after `ClientError` rework
|
||||||
pub fn start_upload(
|
pub fn start_upload(
|
||||||
self,
|
self,
|
||||||
client: &impl sharry::Client,
|
client: &impl sharry::Client,
|
||||||
|
|
|
||||||
12
src/main.rs
12
src/main.rs
|
|
@ -73,12 +73,6 @@ fn print_error(e: &ClientError) {
|
||||||
fn main() {
|
fn main() {
|
||||||
env_logger::init();
|
env_logger::init();
|
||||||
|
|
||||||
println!(
|
|
||||||
"{} to {}!",
|
|
||||||
style("Welcome").magenta().bold(),
|
|
||||||
style("ShrUpl").yellow().bold(),
|
|
||||||
);
|
|
||||||
|
|
||||||
let check_ctrlc = {
|
let check_ctrlc = {
|
||||||
let stop = Arc::new(AtomicBool::new(false));
|
let stop = Arc::new(AtomicBool::new(false));
|
||||||
let stop_ctrlc = stop.clone();
|
let stop_ctrlc = stop.clone();
|
||||||
|
|
@ -99,6 +93,12 @@ fn main() {
|
||||||
let args = Cli::parse();
|
let args = Cli::parse();
|
||||||
info!("args: {args:#?}");
|
info!("args: {args:#?}");
|
||||||
|
|
||||||
|
println!(
|
||||||
|
"{} to {}!",
|
||||||
|
style("Welcome").magenta().bold(),
|
||||||
|
style("ShrUpl").yellow().bold(),
|
||||||
|
);
|
||||||
|
|
||||||
let mut state = AppState::try_resume(&args)
|
let mut state = AppState::try_resume(&args)
|
||||||
.and_then(|state| prompt_continue().then_some(state))
|
.and_then(|state| prompt_continue().then_some(state))
|
||||||
.unwrap_or_else(|| {
|
.unwrap_or_else(|| {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue