Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chcon: move help strings to a markdown file #4445

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/uu/chcon/chcon.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- spell-checker:ignore RFILE -->

# chcon

```
chcon [OPTION]... CONTEXT FILE...
chcon [OPTION]... [-u USER] [-r ROLE] [-l RANGE] [-t TYPE] FILE...
chcon [OPTION]... --reference=RFILE FILE...
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the spell check is complaining here

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added an ignore at the beginning of the file 85567d5
However I am asking myself whether RFILE should not be added to this list as it's not the only place where it's used. https://github.com/uutils/coreutils/blob/f5a9ffe52fb40c045684ea95129f6020e04bfff2/.vscode/cspell.dictionaries/jargon.wordlist.txt
What do you think ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that sounds good!

```


Change the SELinux security context of each FILE to CONTEXT.
With --reference, change the security context of each FILE to that of RFILE.
12 changes: 4 additions & 8 deletions src/uu/chcon/src/chcon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

use clap::builder::ValueParser;
use uucore::error::{UResult, USimpleError, UUsageError};
use uucore::format_usage;
use uucore::{display::Quotable, show_error, show_warning};
use uucore::{help_about, help_usage};

use clap::{Arg, ArgAction, Command};
use selinux::{OpaqueSecurityContext, SecurityContext};
Expand All @@ -22,12 +22,8 @@ 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 ABOUT: &str = help_about!("chcon.md");
const USAGE: &str = help_usage!("chcon.md");

pub mod options {
pub static HELP: &str = "help";
Expand Down Expand Up @@ -154,7 +150,7 @@ pub fn uu_app() -> Command {
Command::new(uucore::util_name())
.version(VERSION)
.about(ABOUT)
.override_usage(format_usage(USAGE))
.override_usage(USAGE)
.infer_long_args(true)
.disable_help_flag(true)
.arg(
Expand Down