From 81f793582c022b5cdebb642fa690bdab109aafff Mon Sep 17 00:00:00 2001 From: sylvestre Date: Thu, 30 Mar 2023 02:40:47 +0000 Subject: [PATCH] deploy: f0e8d44e6e64ee3354f95864c0a25b74cf1c1151 --- dev/src/uu_date/date.rs.html | 20 ++++++++++---------- dev/src/uu_unlink/unlink.rs.html | 8 +++++++- dev/uu_unlink/fn.uu_app.html | 2 +- dev/uu_unlink/fn.uumain.html | 2 +- dev/uu_unlink/index.html | 2 +- dev/uucore/error/trait.UClapError.html | 2 +- 6 files changed, 21 insertions(+), 15 deletions(-) diff --git a/dev/src/uu_date/date.rs.html b/dev/src/uu_date/date.rs.html index 4740b4cd1..3d5be1b4c 100644 --- a/dev/src/uu_date/date.rs.html +++ b/dev/src/uu_date/date.rs.html @@ -469,7 +469,7 @@ use std::io::{BufRead, BufReader}; use std::path::PathBuf; use uucore::display::Quotable; -#[cfg(not(any(target_os = "macos", target_os = "redox")))] +#[cfg(not(any(target_os = "redox")))] use uucore::error::FromIo; use uucore::error::{UResult, USimpleError}; use uucore::{format_usage, help_about, help_usage, show}; @@ -669,19 +669,19 @@ let iter = std::iter::once(date); Box::new(iter) } - DateSource::File(ref path) => match File::open(path) { - Ok(file) => { - let lines = BufReader::new(file).lines(); - let iter = lines.filter_map(Result::ok).map(parse_date); - Box::new(iter) - } - Err(_err) => { + DateSource::File(ref path) => { + if path.is_dir() { return Err(USimpleError::new( 2, - format!("{}: No such file or directory", path.display()), + format!("expected file, got directory {}", path.quote()), )); } - }, + let file = File::open(path) + .map_err_context(|| path.as_os_str().to_string_lossy().to_string())?; + let lines = BufReader::new(file).lines(); + let iter = lines.map_while(Result::ok).map(parse_date); + Box::new(iter) + } DateSource::Now => { let iter = std::iter::once(Ok(now)); Box::new(iter) diff --git a/dev/src/uu_unlink/unlink.rs.html b/dev/src/uu_unlink/unlink.rs.html index 1f4b4d54b..2563ec01b 100644 --- a/dev/src/uu_unlink/unlink.rs.html +++ b/dev/src/uu_unlink/unlink.rs.html @@ -42,6 +42,9 @@ 42 43 44 +45 +46 +47
//  * This file is part of the uutils coreutils package.
 //  *
 //  * (c) Colin Warren <me@zv.ms>
@@ -60,8 +63,10 @@
 
 use uucore::display::Quotable;
 use uucore::error::{FromIo, UResult};
+use uucore::{format_usage, help_about, help_usage};
 
-static ABOUT: &str = "Unlink the file at FILE.";
+const ABOUT: &str = help_about!("unlink.md");
+const USAGE: &str = help_usage!("unlink.md");
 static OPT_PATH: &str = "FILE";
 
 #[uucore::main]
@@ -77,6 +82,7 @@
     Command::new(uucore::util_name())
         .version(crate_version!())
         .about(ABOUT)
+        .override_usage(format_usage(USAGE))
         .infer_long_args(true)
         .arg(
             Arg::new(OPT_PATH)
diff --git a/dev/uu_unlink/fn.uu_app.html b/dev/uu_unlink/fn.uu_app.html
index 358ea4a4d..8e066fe54 100644
--- a/dev/uu_unlink/fn.uu_app.html
+++ b/dev/uu_unlink/fn.uu_app.html
@@ -1 +1 @@
-uu_app in uu_unlink - Rust

Function uu_unlink::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file +uu_app in uu_unlink - Rust

Function uu_unlink::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/dev/uu_unlink/fn.uumain.html b/dev/uu_unlink/fn.uumain.html index 942b03f38..666a9ea17 100644 --- a/dev/uu_unlink/fn.uumain.html +++ b/dev/uu_unlink/fn.uumain.html @@ -1 +1 @@ -uumain in uu_unlink - Rust

Function uu_unlink::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file +uumain in uu_unlink - Rust

Function uu_unlink::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/dev/uu_unlink/index.html b/dev/uu_unlink/index.html index d4f8b7714..aff8a1f83 100644 --- a/dev/uu_unlink/index.html +++ b/dev/uu_unlink/index.html @@ -1 +1 @@ -uu_unlink - Rust
\ No newline at end of file +uu_unlink - Rust
\ No newline at end of file diff --git a/dev/uucore/error/trait.UClapError.html b/dev/uucore/error/trait.UClapError.html index 4f627af47..af6d6f8d4 100644 --- a/dev/uucore/error/trait.UClapError.html +++ b/dev/uucore/error/trait.UClapError.html @@ -1,4 +1,4 @@ UClapError in uucore::error - Rust

Trait uucore::error::UClapError

source ·
pub trait UClapError<T> {
     fn with_exit_code(self, code: i32) -> T;
 }
Expand description

Extension trait for clap::Error to adjust the exit code.

-

Required Methods§

Implementations on Foreign Types§

Implementors§

\ No newline at end of file +

Required Methods§

Implementations on Foreign Types§

Implementors§

\ No newline at end of file