From ff6f61276e0a077a6cc608dc616f71e9e0294ecf Mon Sep 17 00:00:00 2001 From: curtain Date: Mon, 20 Feb 2023 14:25:00 +0800 Subject: [PATCH 01/18] basename: move help strings to markdown file --- src/uu/basename/basename.md | 12 ++++++++++++ src/uu/basename/src/basename.rs | 8 +++----- 2 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 src/uu/basename/basename.md diff --git a/src/uu/basename/basename.md b/src/uu/basename/basename.md new file mode 100644 index 000000000..6af001323 --- /dev/null +++ b/src/uu/basename/basename.md @@ -0,0 +1,12 @@ +# basename + +## Usage +``` +basename NAME [SUFFIX] +basename OPTION... NAME... +``` + +## About + +Print NAME with any leading directory components removed +If specified, also remove a trailing SUFFIX diff --git a/src/uu/basename/src/basename.rs b/src/uu/basename/src/basename.rs index 613c4d67c..bbc8abf75 100644 --- a/src/uu/basename/src/basename.rs +++ b/src/uu/basename/src/basename.rs @@ -11,13 +11,11 @@ use clap::{crate_version, Arg, ArgAction, Command}; use std::path::{is_separator, PathBuf}; use uucore::display::Quotable; use uucore::error::{UResult, UUsageError}; -use uucore::format_usage; +use uucore::{format_usage, help_usage, help_section}; -static ABOUT: &str = r#"Print NAME with any leading directory components removed -If specified, also remove a trailing SUFFIX"#; +static ABOUT: &str = help_section!("about","basename.md"); -const USAGE: &str = "{} NAME [SUFFIX] - {} OPTION... NAME..."; +const USAGE: &str = help_usage!("basename.md"); pub mod options { pub static MULTIPLE: &str = "multiple"; From f70d23b0182dafb87c9b47e1ac82b42aeba8cacc Mon Sep 17 00:00:00 2001 From: curtain Date: Mon, 20 Feb 2023 18:13:36 +0800 Subject: [PATCH 02/18] basename: update format according to #4385 --- src/uu/basename/basename.md | 3 --- src/uu/basename/src/basename.rs | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/uu/basename/basename.md b/src/uu/basename/basename.md index 6af001323..b17cac74a 100644 --- a/src/uu/basename/basename.md +++ b/src/uu/basename/basename.md @@ -1,12 +1,9 @@ # basename -## Usage ``` basename NAME [SUFFIX] basename OPTION... NAME... ``` -## About - Print NAME with any leading directory components removed If specified, also remove a trailing SUFFIX diff --git a/src/uu/basename/src/basename.rs b/src/uu/basename/src/basename.rs index bbc8abf75..48f00f4b8 100644 --- a/src/uu/basename/src/basename.rs +++ b/src/uu/basename/src/basename.rs @@ -11,9 +11,9 @@ use clap::{crate_version, Arg, ArgAction, Command}; use std::path::{is_separator, PathBuf}; use uucore::display::Quotable; use uucore::error::{UResult, UUsageError}; -use uucore::{format_usage, help_usage, help_section}; +use uucore::{format_usage, help_usage, help_about}; -static ABOUT: &str = help_section!("about","basename.md"); +static ABOUT: &str = help_about!("basename.md"); const USAGE: &str = help_usage!("basename.md"); From e37e5ad9159ca4ed8154076b16f3b883942e9fed Mon Sep 17 00:00:00 2001 From: curtain Date: Thu, 23 Feb 2023 09:43:54 +0800 Subject: [PATCH 03/18] basename: fix rustfmt problem --- src/uu/basename/src/basename.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/uu/basename/src/basename.rs b/src/uu/basename/src/basename.rs index 48f00f4b8..ed7faee65 100644 --- a/src/uu/basename/src/basename.rs +++ b/src/uu/basename/src/basename.rs @@ -11,7 +11,7 @@ use clap::{crate_version, Arg, ArgAction, Command}; use std::path::{is_separator, PathBuf}; use uucore::display::Quotable; use uucore::error::{UResult, UUsageError}; -use uucore::{format_usage, help_usage, help_about}; +use uucore::{format_usage, help_about, help_usage}; static ABOUT: &str = help_about!("basename.md"); From f08f4d60165ef092f5031d2f46e4007f60287b5e Mon Sep 17 00:00:00 2001 From: Koki Ueha Date: Wed, 1 Mar 2023 12:44:20 +0000 Subject: [PATCH 04/18] chown: move help strings to markdown file --- src/uu/chown/chown.md | 8 ++++++++ src/uu/chown/src/chown.rs | 8 +++----- 2 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 src/uu/chown/chown.md diff --git a/src/uu/chown/chown.md b/src/uu/chown/chown.md new file mode 100644 index 000000000..11b653ea9 --- /dev/null +++ b/src/uu/chown/chown.md @@ -0,0 +1,8 @@ +# chown + +``` +chown [OPTION]... [OWNER][:[GROUP]] FILE... +chown [OPTION]... --reference=RFILE FILE... +``` + +Change file owner and group diff --git a/src/uu/chown/src/chown.rs b/src/uu/chown/src/chown.rs index 401703cdf..3faecd571 100644 --- a/src/uu/chown/src/chown.rs +++ b/src/uu/chown/src/chown.rs @@ -9,8 +9,8 @@ use uucore::display::Quotable; pub use uucore::entries::{self, Group, Locate, Passwd}; -use uucore::format_usage; use uucore::perms::{chown_base, options, IfFrom}; +use uucore::{format_usage, help_about, help_usage}; use uucore::error::{FromIo, UResult, USimpleError}; @@ -19,11 +19,9 @@ use clap::{crate_version, Arg, ArgAction, ArgMatches, Command}; use std::fs; use std::os::unix::fs::MetadataExt; -static ABOUT: &str = "Change file owner and group"; +static ABOUT: &str = help_about!("chown.md"); -const USAGE: &str = "\ - {} [OPTION]... [OWNER][:[GROUP]] FILE... - {} [OPTION]... --reference=RFILE FILE..."; +const USAGE: &str = help_usage!("chown.md"); fn parse_gid_uid_and_filter(matches: &ArgMatches) -> UResult<(Option, Option, IfFrom)> { let filter = if let Some(spec) = matches.get_one::(options::FROM) { From 18870e37874ac9401e2244ff990f657fb22943b4 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Thu, 2 Mar 2023 14:23:46 +0100 Subject: [PATCH 05/18] GH action: be consistent in the install --- .github/workflows/GnuTests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/GnuTests.yml b/.github/workflows/GnuTests.yml index fd2d66835..b74364f14 100644 --- a/.github/workflows/GnuTests.yml +++ b/.github/workflows/GnuTests.yml @@ -86,7 +86,7 @@ jobs: run: | ## Install dependencies sudo apt-get update - sudo apt-get install autoconf autopoint bison texinfo gperf gcc g++ gdb python3-pyinotify jq valgrind libexpect-perl + sudo apt-get install -y autoconf autopoint bison texinfo gperf gcc g++ gdb python3-pyinotify jq valgrind libexpect-perl - name: Add various locales shell: bash run: | @@ -316,8 +316,8 @@ jobs: - name: Install dependencies run: | ## Install dependencies - sudo apt update - sudo apt install autoconf autopoint bison texinfo gperf gcc g++ gdb python3-pyinotify jq valgrind libexpect-perl -y + sudo apt-get update + sudo apt-get install -y autoconf autopoint bison texinfo gperf gcc g++ gdb python3-pyinotify jq valgrind libexpect-perl - name: Add various locales run: | ## Add various locales From 794df2ae7a53dfec25e658d53515dc43cc9d93cd Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Thu, 2 Mar 2023 14:24:43 +0100 Subject: [PATCH 06/18] GH action: install missing dependencies Fails with: ``` 2023-03-01T22:02:40.2587471Z configure: WARNING: libacl development library was not found or not usable. 2023-03-01T22:02:40.2588131Z configure: WARNING: GNU coreutils will be built without ACL support. 2023-03-01T22:03:03.7621309Z configure: WARNING: libattr development library was not found or not usable. 2023-03-01T22:03:03.7621976Z configure: WARNING: GNU coreutils will be built without xattr support. 2023-03-01T22:03:04.6538269Z configure: WARNING: libcap library was not found or not usable. 2023-03-01T22:03:04.6539022Z configure: WARNING: GNU coreutils will be built without capability support. ``` --- .github/workflows/GnuTests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/GnuTests.yml b/.github/workflows/GnuTests.yml index b74364f14..7c8c307ec 100644 --- a/.github/workflows/GnuTests.yml +++ b/.github/workflows/GnuTests.yml @@ -86,7 +86,7 @@ jobs: run: | ## Install dependencies sudo apt-get update - sudo apt-get install -y autoconf autopoint bison texinfo gperf gcc g++ gdb python3-pyinotify jq valgrind libexpect-perl + sudo apt-get install -y autoconf autopoint bison texinfo gperf gcc g++ gdb python3-pyinotify jq valgrind libexpect-perl libacl1-dev libattr1-dev libcap-dev - name: Add various locales shell: bash run: | @@ -317,7 +317,7 @@ jobs: run: | ## Install dependencies sudo apt-get update - sudo apt-get install -y autoconf autopoint bison texinfo gperf gcc g++ gdb python3-pyinotify jq valgrind libexpect-perl + sudo apt-get install -y autoconf autopoint bison texinfo gperf gcc g++ gdb python3-pyinotify jq valgrind libexpect-perl libacl1-dev libattr1-dev libcap-dev - name: Add various locales run: | ## Add various locales From 2bae3dd4f2c49ad44972df83bd2740ef36415dc6 Mon Sep 17 00:00:00 2001 From: Alexander Kunde Date: Thu, 2 Mar 2023 16:29:43 +0100 Subject: [PATCH 07/18] wc: move help strings to markdown file --- src/uu/wc/src/wc.rs | 7 +++---- src/uu/wc/wc.md | 9 +++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 src/uu/wc/wc.md diff --git a/src/uu/wc/src/wc.rs b/src/uu/wc/src/wc.rs index 4a4838350..21c4643c6 100644 --- a/src/uu/wc/src/wc.rs +++ b/src/uu/wc/src/wc.rs @@ -15,7 +15,7 @@ use count_fast::{count_bytes_chars_and_lines_fast, count_bytes_fast}; use countable::WordCountable; use unicode_width::UnicodeWidthChar; use utf8::{BufReadDecoder, BufReadDecoderError}; -use uucore::{format_usage, show}; +use uucore::{format_usage, show, help_about, help_usage}; use word_count::{TitledWordCount, WordCount}; use clap::{crate_version, Arg, ArgAction, ArgMatches, Command}; @@ -98,9 +98,8 @@ impl Settings { } } -static ABOUT: &str = "Display newline, word, and byte counts for each FILE, and a total line if -more than one FILE is specified. With no FILE, or when FILE is -, read standard input."; -const USAGE: &str = "{} [OPTION]... [FILE]..."; +static ABOUT: &str = help_about!("wc.md"); +const USAGE: &str = help_usage!("wc.md"); pub mod options { pub static BYTES: &str = "bytes"; diff --git a/src/uu/wc/wc.md b/src/uu/wc/wc.md new file mode 100644 index 000000000..f1b243606 --- /dev/null +++ b/src/uu/wc/wc.md @@ -0,0 +1,9 @@ +# wc + +## Usage +``` +wc [OPTION]... [FILE]... +``` + +Display newline, word, and byte counts for each FILE, and a total line if +more than one FILE is specified. With no FILE, or when FILE is -, read standard input. From df5ceaaa97e4e291a31b1ab7645eaef17566777d Mon Sep 17 00:00:00 2001 From: Alexander Kunde Date: Thu, 2 Mar 2023 18:00:31 +0100 Subject: [PATCH 08/18] truncate: move help strings to markdown file --- src/uu/truncate/src/truncate.rs | 26 +++++--------------------- src/uu/truncate/truncate.md | 28 ++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 21 deletions(-) create mode 100644 src/uu/truncate/truncate.md diff --git a/src/uu/truncate/src/truncate.rs b/src/uu/truncate/src/truncate.rs index 090865313..c71f5079b 100644 --- a/src/uu/truncate/src/truncate.rs +++ b/src/uu/truncate/src/truncate.rs @@ -14,7 +14,7 @@ use std::os::unix::fs::FileTypeExt; use std::path::Path; use uucore::display::Quotable; use uucore::error::{FromIo, UResult, USimpleError, UUsageError}; -use uucore::format_usage; +use uucore::{format_usage, help_about, help_section, help_usage}; use uucore::parse_size::{parse_size, ParseSizeError}; #[derive(Debug, Eq, PartialEq)] @@ -73,25 +73,9 @@ impl TruncateMode { } } -const ABOUT: &str = "Shrink or extend the size of each file to the specified size."; -const USAGE: &str = "{} [OPTION]... [FILE]..."; -const LONG_USAGE: &str = "\ -SIZE is an integer with an optional prefix and optional unit. -The available units (K, M, G, T, P, E, Z, and Y) use the following format: - 'KB' => 1000 (kilobytes) - 'K' => 1024 (kibibytes) - 'MB' => 1000*1000 (megabytes) - 'M' => 1024*1024 (mebibytes) - 'GB' => 1000*1000*1000 (gigabytes) - 'G' => 1024*1024*1024 (gibibytes) -SIZE may also be prefixed by one of the following to adjust the size of each -file based on its current size: - '+' => extend by - '-' => reduce by - '<' => at most - '>' => at least - '/' => round down to multiple of - '%' => round up to multiple of"; +const ABOUT: &str = help_about!("truncate.md"); +const AFTER_HELP: &str = help_section!("after help", "truncate.md"); +const USAGE: &str = help_usage!("truncate.md"); pub mod options { pub static IO_BLOCKS: &str = "io-blocks"; @@ -104,7 +88,7 @@ pub mod options { #[uucore::main] pub fn uumain(args: impl uucore::Args) -> UResult<()> { let matches = uu_app() - .after_help(LONG_USAGE) + .after_help(AFTER_HELP) .try_get_matches_from(args) .map_err(|e| { e.print().expect("Error writing clap::Error"); diff --git a/src/uu/truncate/truncate.md b/src/uu/truncate/truncate.md new file mode 100644 index 000000000..64ab4e019 --- /dev/null +++ b/src/uu/truncate/truncate.md @@ -0,0 +1,28 @@ +# truncate + +## Usage + +```sh +truncate [OPTION]... [FILE]... +``` + +Shrink or extend the size of each file to the specified size. + +## After help + +SIZE is an integer with an optional prefix and optional unit. +The available units (K, M, G, T, P, E, Z, and Y) use the following format: + 'KB' => 1000 (kilobytes) + 'K' => 1024 (kibibytes) + 'MB' => 1000*1000 (megabytes) + 'M' => 1024*1024 (mebibytes) + 'GB' => 1000*1000*1000 (gigabytes) + 'G' => 1024*1024*1024 (gibibytes) +SIZE may also be prefixed by one of the following to adjust the size of each +file based on its current size: + '+' => extend by + '-' => reduce by + '<' => at most + '>' => at least + '/' => round down to multiple of + '%' => round up to multiple of \ No newline at end of file From 427611122229b08cb3f8f74ac318a36dceb82f0f Mon Sep 17 00:00:00 2001 From: Alexander Kunde Date: Thu, 2 Mar 2023 18:10:53 +0100 Subject: [PATCH 09/18] change ABOUT from static to const --- src/uu/wc/src/wc.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/uu/wc/src/wc.rs b/src/uu/wc/src/wc.rs index 21c4643c6..c1f4a2db1 100644 --- a/src/uu/wc/src/wc.rs +++ b/src/uu/wc/src/wc.rs @@ -98,7 +98,7 @@ impl Settings { } } -static ABOUT: &str = help_about!("wc.md"); +const ABOUT: &str = help_about!("wc.md"); const USAGE: &str = help_usage!("wc.md"); pub mod options { From 4bae3e0cd977f60a2cc17cc5ca483db4ed7d17c6 Mon Sep 17 00:00:00 2001 From: Alexander Kunde Date: Thu, 2 Mar 2023 18:14:10 +0100 Subject: [PATCH 10/18] remove redundant line --- src/uu/wc/wc.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/uu/wc/wc.md b/src/uu/wc/wc.md index f1b243606..db470a423 100644 --- a/src/uu/wc/wc.md +++ b/src/uu/wc/wc.md @@ -1,7 +1,6 @@ # wc -## Usage -``` +```sh wc [OPTION]... [FILE]... ``` From b73d5206f502a46d13dc1d51e1907547d2a2a862 Mon Sep 17 00:00:00 2001 From: Alexander Kunde Date: Thu, 2 Mar 2023 18:18:40 +0100 Subject: [PATCH 11/18] remove redundant line in markdown --- src/uu/truncate/truncate.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/uu/truncate/truncate.md b/src/uu/truncate/truncate.md index 64ab4e019..36e71e999 100644 --- a/src/uu/truncate/truncate.md +++ b/src/uu/truncate/truncate.md @@ -1,7 +1,5 @@ # truncate -## Usage - ```sh truncate [OPTION]... [FILE]... ``` From aead80efdbb5e87f2ba72817599a142212099ffb Mon Sep 17 00:00:00 2001 From: Alexander Kunde Date: Thu, 2 Mar 2023 18:55:11 +0100 Subject: [PATCH 12/18] cargo fmt --- src/uu/wc/src/wc.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/uu/wc/src/wc.rs b/src/uu/wc/src/wc.rs index c1f4a2db1..0b7b164a8 100644 --- a/src/uu/wc/src/wc.rs +++ b/src/uu/wc/src/wc.rs @@ -15,7 +15,7 @@ use count_fast::{count_bytes_chars_and_lines_fast, count_bytes_fast}; use countable::WordCountable; use unicode_width::UnicodeWidthChar; use utf8::{BufReadDecoder, BufReadDecoderError}; -use uucore::{format_usage, show, help_about, help_usage}; +use uucore::{format_usage, help_about, help_usage, show}; use word_count::{TitledWordCount, WordCount}; use clap::{crate_version, Arg, ArgAction, ArgMatches, Command}; From 73bb60d72490cefbf8926ca170a83720dd13bacd Mon Sep 17 00:00:00 2001 From: Alexander Kunde Date: Thu, 2 Mar 2023 18:56:08 +0100 Subject: [PATCH 13/18] cargo fmt --- src/uu/truncate/src/truncate.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/uu/truncate/src/truncate.rs b/src/uu/truncate/src/truncate.rs index c71f5079b..f050b52b4 100644 --- a/src/uu/truncate/src/truncate.rs +++ b/src/uu/truncate/src/truncate.rs @@ -14,8 +14,8 @@ use std::os::unix::fs::FileTypeExt; use std::path::Path; use uucore::display::Quotable; use uucore::error::{FromIo, UResult, USimpleError, UUsageError}; -use uucore::{format_usage, help_about, help_section, help_usage}; use uucore::parse_size::{parse_size, ParseSizeError}; +use uucore::{format_usage, help_about, help_section, help_usage}; #[derive(Debug, Eq, PartialEq)] enum TruncateMode { From d29119728af09da6cc9955f7832a3d55dd2bb758 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guilherme=20Gon=C3=A7alves?= Date: Tue, 28 Feb 2023 10:06:42 +0000 Subject: [PATCH 14/18] tests/du: run test_du_time with TZ=UTC. du --time formats a file's timestamp according to the local timezone, but the test implicitly assumed UTC. This caused it to fail when running locally in my UTC+1 machine. $ cargo test --features "du touch" --no-default-features Failure: https://gist.github.com/eggpi/651e01559b7c59e9457c1b22fe4c0c19 --- tests/by-util/test_du.rs | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/tests/by-util/test_du.rs b/tests/by-util/test_du.rs index 1232beda9..4a3cc3530 100644 --- a/tests/by-util/test_du.rs +++ b/tests/by-util/test_du.rs @@ -391,7 +391,12 @@ fn test_du_h_flag_empty_file() { fn test_du_time() { let ts = TestScenario::new(util_name!()); + // du --time formats the timestamp according to the local timezone. We set the TZ + // environment variable to UTC in the commands below to ensure consistent outputs + // and test results regardless of the timezone of the machine this test runs in. + ts.ccmd("touch") + .env("TZ", "UTC") .arg("-a") .arg("-t") .arg("201505150000") @@ -399,19 +404,35 @@ fn test_du_time() { .succeeds(); ts.ccmd("touch") + .env("TZ", "UTC") .arg("-m") .arg("-t") .arg("201606160000") .arg("date_test") .succeeds(); - let result = ts.ucmd().arg("--time").arg("date_test").succeeds(); + let result = ts + .ucmd() + .env("TZ", "UTC") + .arg("--time") + .arg("date_test") + .succeeds(); result.stdout_only("0\t2016-06-16 00:00\tdate_test\n"); - let result = ts.ucmd().arg("--time=atime").arg("date_test").succeeds(); + let result = ts + .ucmd() + .env("TZ", "UTC") + .arg("--time=atime") + .arg("date_test") + .succeeds(); result.stdout_only("0\t2015-05-15 00:00\tdate_test\n"); - let result = ts.ucmd().arg("--time=ctime").arg("date_test").succeeds(); + let result = ts + .ucmd() + .env("TZ", "UTC") + .arg("--time=ctime") + .arg("date_test") + .succeeds(); result.stdout_only("0\t2016-06-16 00:00\tdate_test\n"); if birth_supported() { 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 15/18] 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 000000000..c4266be6e --- /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 3acd2ea43..2f316393a 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"; From c35d1762aaf758452fbfaa68337446c490c55766 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 3 Mar 2023 12:53:45 +0100 Subject: [PATCH 16/18] Add RFILE to the exclude list --- src/uu/chown/chown.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/uu/chown/chown.md b/src/uu/chown/chown.md index 11b653ea9..83101c74c 100644 --- a/src/uu/chown/chown.md +++ b/src/uu/chown/chown.md @@ -1,3 +1,4 @@ + # chown ``` From 53d3d4d616d81140923d9ce74cd99f1862cd16c7 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 3 Mar 2023 13:12:49 +0100 Subject: [PATCH 17/18] remove the sh in the syntax --- src/uu/truncate/truncate.md | 1 - 1 file changed, 1 deletion(-) diff --git a/src/uu/truncate/truncate.md b/src/uu/truncate/truncate.md index 36e71e999..841c4b16c 100644 --- a/src/uu/truncate/truncate.md +++ b/src/uu/truncate/truncate.md @@ -1,6 +1,5 @@ # truncate -```sh truncate [OPTION]... [FILE]... ``` From 2085d4d4ab1ec1ca977129466c2872ff8fc8728f Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 3 Mar 2023 13:52:47 +0100 Subject: [PATCH 18/18] remove the sh in the syntax --- src/uu/wc/wc.md | 1 - 1 file changed, 1 deletion(-) diff --git a/src/uu/wc/wc.md b/src/uu/wc/wc.md index db470a423..3d0014b37 100644 --- a/src/uu/wc/wc.md +++ b/src/uu/wc/wc.md @@ -1,6 +1,5 @@ # wc -```sh wc [OPTION]... [FILE]... ```