Merge pull request #4450 from papparapa/chown-move-help-strings-to-md-file

chown: move help strings to markdown file
This commit is contained in:
Sylvestre Ledru 2023-03-03 18:06:36 +01:00 committed by GitHub
commit 9d5dc500e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 5 deletions

9
src/uu/chown/chown.md Normal file
View file

@ -0,0 +1,9 @@
<!-- spell-checker:ignore RFILE -->
# chown
```
chown [OPTION]... [OWNER][:[GROUP]] FILE...
chown [OPTION]... --reference=RFILE FILE...
```
Change file owner and group

View file

@ -9,8 +9,8 @@
use uucore::display::Quotable; use uucore::display::Quotable;
pub use uucore::entries::{self, Group, Locate, Passwd}; pub use uucore::entries::{self, Group, Locate, Passwd};
use uucore::format_usage;
use uucore::perms::{chown_base, options, IfFrom}; use uucore::perms::{chown_base, options, IfFrom};
use uucore::{format_usage, help_about, help_usage};
use uucore::error::{FromIo, UResult, USimpleError}; use uucore::error::{FromIo, UResult, USimpleError};
@ -19,11 +19,9 @@ use clap::{crate_version, Arg, ArgAction, ArgMatches, Command};
use std::fs; use std::fs;
use std::os::unix::fs::MetadataExt; use std::os::unix::fs::MetadataExt;
static ABOUT: &str = "Change file owner and group"; static ABOUT: &str = help_about!("chown.md");
const USAGE: &str = "\ const USAGE: &str = help_usage!("chown.md");
{} [OPTION]... [OWNER][:[GROUP]] FILE...
{} [OPTION]... --reference=RFILE FILE...";
fn parse_gid_uid_and_filter(matches: &ArgMatches) -> UResult<(Option<u32>, Option<u32>, IfFrom)> { fn parse_gid_uid_and_filter(matches: &ArgMatches) -> UResult<(Option<u32>, Option<u32>, IfFrom)> {
let filter = if let Some(spec) = matches.get_one::<String>(options::FROM) { let filter = if let Some(spec) = matches.get_one::<String>(options::FROM) {