Skip to content

Commit

Permalink
chcon: move help strings to a markdown file (#4437)
Browse files Browse the repository at this point in the history
* arch: move help strings to a markdown file #4368

---------

Co-authored-by: zleyyij <[email protected]>
Co-authored-by: Sylvestre Ledru <[email protected]>
Co-authored-by: Terts Diepraam <[email protected]>
  • Loading branch information
4 people authored Mar 3, 2023
1 parent 932cf58 commit 9fb6477
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
11 changes: 11 additions & 0 deletions src/uu/chcon/chcon.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- spell-checker:ignore (vars) RFILE -->
# 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.
14 changes: 4 additions & 10 deletions src/uu/chcon/src/chcon.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand All @@ -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";
Expand Down

0 comments on commit 9fb6477

Please sign in to comment.