From f08f4d60165ef092f5031d2f46e4007f60287b5e Mon Sep 17 00:00:00 2001 From: Koki Ueha Date: Wed, 1 Mar 2023 12:44:20 +0000 Subject: [PATCH 1/2] chown: move help strings to markdown file --- src/uu/chown/chown.md | 8 ++++++++ src/uu/chown/src/chown.rs | 8 +++----- 2 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 src/uu/chown/chown.md diff --git a/src/uu/chown/chown.md b/src/uu/chown/chown.md new file mode 100644 index 000000000..11b653ea9 --- /dev/null +++ b/src/uu/chown/chown.md @@ -0,0 +1,8 @@ +# chown + +``` +chown [OPTION]... [OWNER][:[GROUP]] FILE... +chown [OPTION]... --reference=RFILE FILE... +``` + +Change file owner and group diff --git a/src/uu/chown/src/chown.rs b/src/uu/chown/src/chown.rs index 401703cdf..3faecd571 100644 --- a/src/uu/chown/src/chown.rs +++ b/src/uu/chown/src/chown.rs @@ -9,8 +9,8 @@ use uucore::display::Quotable; pub use uucore::entries::{self, Group, Locate, Passwd}; -use uucore::format_usage; use uucore::perms::{chown_base, options, IfFrom}; +use uucore::{format_usage, help_about, help_usage}; use uucore::error::{FromIo, UResult, USimpleError}; @@ -19,11 +19,9 @@ use clap::{crate_version, Arg, ArgAction, ArgMatches, Command}; use std::fs; use std::os::unix::fs::MetadataExt; -static ABOUT: &str = "Change file owner and group"; +static ABOUT: &str = help_about!("chown.md"); -const USAGE: &str = "\ - {} [OPTION]... [OWNER][:[GROUP]] FILE... - {} [OPTION]... --reference=RFILE FILE..."; +const USAGE: &str = help_usage!("chown.md"); fn parse_gid_uid_and_filter(matches: &ArgMatches) -> UResult<(Option, Option, IfFrom)> { let filter = if let Some(spec) = matches.get_one::(options::FROM) { From c35d1762aaf758452fbfaa68337446c490c55766 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 3 Mar 2023 12:53:45 +0100 Subject: [PATCH 2/2] Add RFILE to the exclude list --- src/uu/chown/chown.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/uu/chown/chown.md b/src/uu/chown/chown.md index 11b653ea9..83101c74c 100644 --- a/src/uu/chown/chown.md +++ b/src/uu/chown/chown.md @@ -1,3 +1,4 @@ + # chown ```