From 9fb6477c895fc9bb590c8f088f46a89cd76b984e Mon Sep 17 00:00:00 2001 From: zleyyij <75810274+zleyyij@users.noreply.github.com> Date: Fri, 3 Mar 2023 04:37:09 -0700 Subject: [PATCH] chcon: move help strings to a markdown file (#4437) * arch: move help strings to a markdown file #4368 --------- Co-authored-by: zleyyij Co-authored-by: Sylvestre Ledru Co-authored-by: Terts Diepraam --- src/uu/chcon/chcon.md | 11 +++++++++++ src/uu/chcon/src/chcon.rs | 14 ++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) create mode 100644 src/uu/chcon/chcon.md diff --git a/src/uu/chcon/chcon.md b/src/uu/chcon/chcon.md new file mode 100644 index 00000000000..c4266be6e9d --- /dev/null +++ b/src/uu/chcon/chcon.md @@ -0,0 +1,11 @@ + +# chcon + +``` +chcon [OPTION]... CONTEXT FILE... +chcon [OPTION]... [-u USER] [-r ROLE] [-l RANGE] [-t TYPE] FILE... +chcon [OPTION]... --reference=RFILE FILE... +``` + +Change the SELinux security context of each FILE to CONTEXT. +With --reference, change the security context of each FILE to that of RFILE. \ No newline at end of file diff --git a/src/uu/chcon/src/chcon.rs b/src/uu/chcon/src/chcon.rs index 3acd2ea430c..2f316393a22 100644 --- a/src/uu/chcon/src/chcon.rs +++ b/src/uu/chcon/src/chcon.rs @@ -1,11 +1,9 @@ // spell-checker:ignore (vars) RFILE - #![allow(clippy::upper_case_acronyms)] use clap::builder::ValueParser; use uucore::error::{UResult, USimpleError, UUsageError}; -use uucore::format_usage; -use uucore::{display::Quotable, show_error, show_warning}; +use uucore::{display::Quotable, format_usage, help_about, help_usage, show_error, show_warning}; use clap::{Arg, ArgAction, Command}; use selinux::{OpaqueSecurityContext, SecurityContext}; @@ -21,13 +19,9 @@ mod fts; use errors::*; -static VERSION: &str = env!("CARGO_PKG_VERSION"); -static ABOUT: &str = "Change the SELinux security context of each FILE to CONTEXT. \n\ - With --reference, change the security context of each FILE to that of RFILE."; -const USAGE: &str = "\ - {} [OPTION]... CONTEXT FILE... \n \ - {} [OPTION]... [-u USER] [-r ROLE] [-l RANGE] [-t TYPE] FILE... \n \ - {} [OPTION]... --reference=RFILE FILE..."; +const VERSION: &str = env!("CARGO_PKG_VERSION"); +const ABOUT: &str = help_about!("chcon.md"); +const USAGE: &str = help_usage!("chcon.md"); pub mod options { pub static HELP: &str = "help";