From 023eb73fd9d55a7f1a94e3e02a10045939e5dbee Mon Sep 17 00:00:00 2001 From: sylvestre Date: Wed, 8 Mar 2023 02:57:40 +0000 Subject: [PATCH] deploy: f0e8d44e6e64ee3354f95864c0a25b74cf1c1151 --- dev/src/uu_csplit/csplit.rs.html | 10 +++---- dev/src/uu_echo/echo.rs.html | 42 +++------------------------- dev/src/uu_hostname/hostname.rs.html | 6 ++-- dev/src/uu_install/install.rs.html | 8 ++---- dev/src/uu_sleep/sleep.rs.html | 24 +++++++++------- dev/uu_echo/fn.uu_app.html | 2 +- dev/uu_echo/fn.uumain.html | 2 +- dev/uu_echo/index.html | 2 +- dev/uu_install/fn.uu_app.html | 2 +- dev/uu_install/fn.uumain.html | 2 +- dev/uu_install/index.html | 2 +- dev/uu_sleep/index.html | 2 +- 12 files changed, 36 insertions(+), 68 deletions(-) diff --git a/dev/src/uu_csplit/csplit.rs.html b/dev/src/uu_csplit/csplit.rs.html index 9158fa72a..d25a919bc 100644 --- a/dev/src/uu_csplit/csplit.rs.html +++ b/dev/src/uu_csplit/csplit.rs.html @@ -831,7 +831,7 @@ use regex::Regex; use uucore::display::Quotable; use uucore::error::{FromIo, UResult}; -use uucore::{crash_if_err, format_usage}; +use uucore::{crash_if_err, format_usage, help_about, help_section, help_usage}; mod csplit_error; mod patterns; @@ -840,9 +840,9 @@ use crate::csplit_error::CsplitError; use crate::split_name::SplitName; -static ABOUT: &str = "Split a file into sections determined by context lines"; -static LONG_HELP: &str = "Output pieces of FILE separated by PATTERN(s) to files 'xx00', 'xx01', ..., and output byte counts of each piece to standard output."; -const USAGE: &str = "{} [OPTION]... FILE PATTERN..."; +const ABOUT: &str = help_about!("csplit.md"); +const AFTER_HELP: &str = help_section!("after help", "csplit.md"); +const USAGE: &str = help_usage!("csplit.md"); mod options { pub const SUFFIX_FORMAT: &str = "suffix-format"; @@ -1632,7 +1632,7 @@ .action(clap::ArgAction::Append) .required(true), ) - .after_help(LONG_HELP) + .after_help(AFTER_HELP) }
\ No newline at end of file diff --git a/dev/src/uu_echo/echo.rs.html b/dev/src/uu_echo/echo.rs.html index 867a63b0f..b2ea872a5 100644 --- a/dev/src/uu_echo/echo.rs.html +++ b/dev/src/uu_echo/echo.rs.html @@ -166,23 +166,6 @@ 166 167 168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185
// This file is part of the uutils coreutils package.
 //
 // (c) Derek Chiang <derekchiang93@gmail.com>
@@ -196,28 +179,11 @@
 use std::iter::Peekable;
 use std::str::Chars;
 use uucore::error::{FromIo, UResult};
-use uucore::format_usage;
+use uucore::{format_usage, help_about, help_section, help_usage};
 
-const ABOUT: &str = "Display a line of text";
-const USAGE: &str = "{} [OPTIONS]... [STRING]...";
-const AFTER_HELP: &str = r#"
- Echo the STRING(s) to standard output.
-
- If -e is in effect, the following sequences are recognized:
-
- \\\\      backslash
- \\a      alert (BEL)
- \\b      backspace
- \\c      produce no further output
- \\e      escape
- \\f      form feed
- \\n      new line
- \\r      carriage return
- \\t      horizontal tab
- \\v      vertical tab
- \\0NNN   byte with octal value NNN (1 to 3 digits)
- \\xHH    byte with hexadecimal value HH (1 to 2 digits)
-"#;
+const ABOUT: &str = help_about!("echo.md");
+const USAGE: &str = help_usage!("echo.md");
+const AFTER_HELP: &str = help_section!("after help", "echo.md");
 
 mod options {
     pub const STRING: &str = "STRING";
diff --git a/dev/src/uu_hostname/hostname.rs.html b/dev/src/uu_hostname/hostname.rs.html
index c49b0bba1..876ff3a71 100644
--- a/dev/src/uu_hostname/hostname.rs.html
+++ b/dev/src/uu_hostname/hostname.rs.html
@@ -187,11 +187,11 @@
 
 use uucore::{
     error::{FromIo, UResult},
-    format_usage,
+    format_usage, help_about, help_usage,
 };
 
-static ABOUT: &str = "Display or set the system's host name.";
-const USAGE: &str = "{} [OPTION]... [HOSTNAME]";
+const ABOUT: &str = help_about!("hostname.md");
+const USAGE: &str = help_usage!("hostname.md");
 
 static OPT_DOMAIN: &str = "domain";
 static OPT_IP_ADDRESS: &str = "ip-address";
diff --git a/dev/src/uu_install/install.rs.html b/dev/src/uu_install/install.rs.html
index af1c71e04..648965af8 100644
--- a/dev/src/uu_install/install.rs.html
+++ b/dev/src/uu_install/install.rs.html
@@ -867,7 +867,6 @@
 867
 868
 869
-870
 
//  * This file is part of the uutils coreutils package.
 //  *
 //  * (c) Ben Eills <ben@beneills.com>
@@ -889,7 +888,7 @@
 use uucore::fs::dir_strip_dot_for_creation;
 use uucore::mode::get_umask;
 use uucore::perms::{wrap_chown, Verbosity, VerbosityLevel};
-use uucore::{format_usage, show, show_error, show_if_err, uio_error};
+use uucore::{format_usage, help_about, help_usage, show, show_error, show_if_err, uio_error};
 
 use libc::{getegid, geteuid};
 use std::error::Error;
@@ -1014,9 +1013,8 @@
     }
 }
 
-static ABOUT: &str = "Copy SOURCE to DEST or multiple SOURCE(s) to the existing
- DIRECTORY, while setting permission modes and owner/group";
-const USAGE: &str = "{} [OPTION]... [FILE]...";
+const ABOUT: &str = help_about!("install.md");
+const USAGE: &str = help_usage!("install.md");
 
 static OPT_COMPARE: &str = "compare";
 static OPT_DIRECTORY: &str = "directory";
diff --git a/dev/src/uu_sleep/sleep.rs.html b/dev/src/uu_sleep/sleep.rs.html
index 742bbc721..0f429364f 100644
--- a/dev/src/uu_sleep/sleep.rs.html
+++ b/dev/src/uu_sleep/sleep.rs.html
@@ -76,6 +76,8 @@
 76
 77
 78
+79
+80
 
//  * This file is part of the uutils coreutils package.
 //  *
 //  * (c) Alex Lyon <arcterus@mail.com>
@@ -88,7 +90,7 @@
 
 use uucore::{
     error::{UResult, USimpleError, UUsageError},
-    format_usage, help_about, help_section, help_usage, show,
+    format_usage, help_about, help_section, help_usage, show_error,
 };
 
 use clap::{crate_version, Arg, ArgAction, Command};
@@ -139,15 +141,17 @@
 
 fn sleep(args: &[&str]) -> UResult<()> {
     let mut arg_error = false;
-    let intervals = args.iter().map(|s| match uucore::parse_time::from_str(s) {
-        Ok(result) => result,
-        Err(err) => {
-            arg_error = true;
-            show!(USimpleError::new(1, err));
-            Duration::new(0, 0)
-        }
-    });
-    let sleep_dur = intervals.fold(Duration::new(0, 0), |acc, n| acc + n);
+    let sleep_dur = args
+        .iter()
+        .filter_map(|input| {
+            uucore::parse_time::from_str(input.trim()).ok().or_else(|| {
+                arg_error = true;
+                show_error!("invalid time interval '{input}'");
+                None
+            })
+        })
+        .fold(Duration::ZERO, |acc, n| acc.saturating_add(n));
+
     if arg_error {
         return Err(UUsageError::new(1, ""));
     };
diff --git a/dev/uu_echo/fn.uu_app.html b/dev/uu_echo/fn.uu_app.html
index 97fa32556..8da78818c 100644
--- a/dev/uu_echo/fn.uu_app.html
+++ b/dev/uu_echo/fn.uu_app.html
@@ -1 +1 @@
-uu_app in uu_echo - Rust

Function uu_echo::uu_app

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

Function uu_echo::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/dev/uu_echo/fn.uumain.html b/dev/uu_echo/fn.uumain.html index 9bb7d78d2..20fb18d28 100644 --- a/dev/uu_echo/fn.uumain.html +++ b/dev/uu_echo/fn.uumain.html @@ -1 +1 @@ -uumain in uu_echo - Rust

Function uu_echo::uumain

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

Function uu_echo::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/dev/uu_echo/index.html b/dev/uu_echo/index.html index 2f9116ae2..4151e5e5b 100644 --- a/dev/uu_echo/index.html +++ b/dev/uu_echo/index.html @@ -1 +1 @@ -uu_echo - Rust
\ No newline at end of file +uu_echo - Rust
\ No newline at end of file diff --git a/dev/uu_install/fn.uu_app.html b/dev/uu_install/fn.uu_app.html index 67ab2fadd..ae5ac3376 100644 --- a/dev/uu_install/fn.uu_app.html +++ b/dev/uu_install/fn.uu_app.html @@ -1 +1 @@ -uu_app in uu_install - Rust

Function uu_install::uu_app

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

Function uu_install::uu_app

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

Function uu_install::uumain

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

Function uu_install::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/dev/uu_install/index.html b/dev/uu_install/index.html index 7eca2eeff..c4c24d97d 100644 --- a/dev/uu_install/index.html +++ b/dev/uu_install/index.html @@ -1 +1 @@ -uu_install - Rust
\ No newline at end of file +uu_install - Rust
\ No newline at end of file diff --git a/dev/uu_sleep/index.html b/dev/uu_sleep/index.html index bc8378f7f..3d503fefd 100644 --- a/dev/uu_sleep/index.html +++ b/dev/uu_sleep/index.html @@ -1 +1 @@ -uu_sleep - Rust
\ No newline at end of file +uu_sleep - Rust
\ No newline at end of file