1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-08-01 13:37:48 +00:00

runcon: move help strings to markdown file (#4774)

This commit is contained in:
Masahito Osako 2023-04-24 15:01:28 +09:00 committed by GitHub
parent 698bdf5f9a
commit d18ccc6a2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 13 deletions

18
src/uu/runcon/runcon.md Normal file
View file

@ -0,0 +1,18 @@
# runcon
```
runcon [CONTEXT COMMAND [ARG...]]
runcon [-c] [-u USER] [-r ROLE] [-t TYPE] [-l RANGE] COMMAND [ARG...]";
```
Run command with specified security context under SELinux enabled systems.
## After Help
Run COMMAND with completely-specified CONTEXT, or with current or transitioned security context modified by one or more of LEVEL, ROLE, TYPE, and USER.
If none of --compute, --type, --user, --role or --range is specified, then the first argument is used as the complete context.
Note that only carefully-chosen contexts are likely to successfully run.
With neither CONTEXT nor COMMAND are specified, then this prints the current security context.

View file

@ -5,7 +5,7 @@ use uucore::error::{UResult, UUsageError};
use clap::{crate_version, Arg, ArgAction, Command};
use selinux::{OpaqueSecurityContext, SecurityClass, SecurityContext};
use uucore::format_usage;
use uucore::{format_usage, help_about, help_section, help_usage};
use std::borrow::Cow;
use std::ffi::{CStr, CString, OsStr, OsString};
@ -18,18 +18,9 @@ mod errors;
use errors::error_exit_status;
use errors::{Error, Result, RunconError};
const ABOUT: &str = "Run command with specified security context.";
const USAGE: &str = "\
{} [CONTEXT COMMAND [ARG...]]
{} [-c] [-u USER] [-r ROLE] [-t TYPE] [-l RANGE] COMMAND [ARG...]";
const DESCRIPTION: &str = "Run COMMAND with completely-specified CONTEXT, or with current or \
transitioned security context modified by one or more of \
LEVEL, ROLE, TYPE, and USER.\n\n\
If none of --compute, --type, --user, --role or --range is specified, \
then the first argument is used as the complete context.\n\n\
Note that only carefully-chosen contexts are likely to successfully run.\n\n\
With neither CONTEXT nor COMMAND are specified, \
then this prints the current security context.";
const ABOUT: &str = help_about!("runcon.md");
const USAGE: &str = help_usage!("runcon.md");
const DESCRIPTION: &str = help_section!("after help", "runcon.md");
pub mod options {
pub const COMPUTE: &str = "compute";