From f75c427b96e4fa5762952a58f6eff216afcfb183 Mon Sep 17 00:00:00 2001 From: Akhil Mohan Date: Sun, 5 Mar 2023 18:13:38 +0530 Subject: [PATCH] chgrp: move help strings to markdown file (#4461) * chgrp: move help strings to markdown file Signed-off-by: Akhil Mohan --- src/uu/chgrp/chgrp.md | 10 ++++++++++ src/uu/chgrp/src/chgrp.rs | 9 +++------ 2 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 src/uu/chgrp/chgrp.md diff --git a/src/uu/chgrp/chgrp.md b/src/uu/chgrp/chgrp.md new file mode 100644 index 000000000..47c1ae5e4 --- /dev/null +++ b/src/uu/chgrp/chgrp.md @@ -0,0 +1,10 @@ + + +# chgrp + +``` +chgrp [OPTION]... GROUP FILE... +[OPTION]... --reference=RFILE FILE... +``` + +Change the group of each FILE to GROUP. diff --git a/src/uu/chgrp/src/chgrp.rs b/src/uu/chgrp/src/chgrp.rs index 3b8d0bab0..dcbb82798 100644 --- a/src/uu/chgrp/src/chgrp.rs +++ b/src/uu/chgrp/src/chgrp.rs @@ -10,20 +10,17 @@ use uucore::display::Quotable; pub use uucore::entries; use uucore::error::{FromIo, UResult, USimpleError}; -use uucore::format_usage; use uucore::perms::{chown_base, options, IfFrom}; +use uucore::{format_usage, help_about, help_usage}; use clap::{Arg, ArgAction, ArgMatches, Command}; use std::fs; use std::os::unix::fs::MetadataExt; -static ABOUT: &str = "Change the group of each FILE to GROUP."; static VERSION: &str = env!("CARGO_PKG_VERSION"); - -const USAGE: &str = "\ - {} [OPTION]... GROUP FILE...\n \ - {} [OPTION]... --reference=RFILE FILE..."; +static ABOUT: &str = help_about!("chgrp.md"); +const USAGE: &str = help_usage!("chgrp.md"); fn parse_gid_and_uid(matches: &ArgMatches) -> UResult<(Option, Option, IfFrom)> { let dest_gid = if let Some(file) = matches.get_one::(options::REFERENCE) {