1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

chgrp: move help strings to markdown file (#4461)

* chgrp: move help strings to markdown file

Signed-off-by: Akhil Mohan <akhilerm@gmail.com>
This commit is contained in:
Akhil Mohan 2023-03-05 18:13:38 +05:30 committed by GitHub
parent c386b27043
commit f75c427b96
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 6 deletions

10
src/uu/chgrp/chgrp.md Normal file
View file

@ -0,0 +1,10 @@
<!-- spell-checker:ignore (vars) RFILE -->
# chgrp
```
chgrp [OPTION]... GROUP FILE...
[OPTION]... --reference=RFILE FILE...
```
Change the group of each FILE to GROUP.

View file

@ -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<u32>, Option<u32>, IfFrom)> {
let dest_gid = if let Some(file) = matches.get_one::<String>(options::REFERENCE) {