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) {