From 053a1216a3c0b3e3e1a077a1552a100c616a7618 Mon Sep 17 00:00:00 2001 From: Piotr Kwiecinski Date: Sun, 19 Mar 2023 15:46:42 +0100 Subject: [PATCH] groups: move move help strings to markdown file --- src/uu/groups/groups.md | 8 ++++++++ src/uu/groups/src/groups.rs | 14 +++----------- 2 files changed, 11 insertions(+), 11 deletions(-) create mode 100644 src/uu/groups/groups.md diff --git a/src/uu/groups/groups.md b/src/uu/groups/groups.md new file mode 100644 index 000000000..1d11d5e46 --- /dev/null +++ b/src/uu/groups/groups.md @@ -0,0 +1,8 @@ +# groups + +``` +groups [OPTION]... [USERNAME]... +``` + +Print group memberships for each `USERNAME` or, if no `USERNAME` is specified, for +the current process (which may differ if the groups data‐base has changed). diff --git a/src/uu/groups/src/groups.rs b/src/uu/groups/src/groups.rs index c866d0e1b..720a4552c 100644 --- a/src/uu/groups/src/groups.rs +++ b/src/uu/groups/src/groups.rs @@ -17,23 +17,15 @@ use std::error::Error; use std::fmt::Display; -use uucore::{ - display::Quotable, - entries::{get_groups_gnu, gid2grp, Locate, Passwd}, - error::{UError, UResult}, - format_usage, show, -}; +use uucore::{display::Quotable, entries::{get_groups_gnu, gid2grp, Locate, Passwd}, error::{UError, UResult}, format_usage, help_about, help_usage, show}; use clap::{crate_version, Arg, ArgAction, Command}; mod options { pub const USERS: &str = "USERNAME"; } -static ABOUT: &str = "Print group memberships for each USERNAME or, \ - if no USERNAME is specified, for\nthe current process \ - (which may differ if the groups data‐base has changed)."; - -const USAGE: &str = "{} [OPTION]... [USERNAME]..."; +const ABOUT: &str = help_about!("groups.md"); +const USAGE: &str = help_usage!("groups.md"); #[derive(Debug)] enum GroupsError {