diff --git a/README.md b/README.md index dbcd7d860..895e3c9a9 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ that scripts can be easily transferred between platforms. ## Documentation uutils has both user and developer documentation available: -- [User Manual](https://uutils.github.io/coreutils/book/) +- [User Manual](https://uutils.github.io/coreutils/docs/) - [Developer Documentation](https://docs.rs/crate/coreutils/) Both can also be generated locally, the instructions for that can be found in @@ -302,7 +302,7 @@ make PREFIX=/my/path uninstall Below is the evolution of how many GNU tests uutils passes. A more detailed breakdown of the GNU test results of the main branch can be found -[in the user manual](https://uutils.github.io/coreutils/book/test_coverage.html). +[in the user manual](https://uutils.github.io/coreutils/docs/test_coverage.html). See for the main meta bugs (many are missing). diff --git a/src/uu/cksum/src/cksum.rs b/src/uu/cksum/src/cksum.rs index c5c362c59..312e4355f 100644 --- a/src/uu/cksum/src/cksum.rs +++ b/src/uu/cksum/src/cksum.rs @@ -436,23 +436,27 @@ pub fn uu_app() -> Command { .long(options::LENGTH) .value_parser(value_parser!(usize)) .short('l') - .help("digest length in bits; must not exceed the max for the blake2 algorithm and must be a multiple of 8") + .help( + "digest length in bits; must not exceed the max for the blake2 algorithm \ + and must be a multiple of 8", + ) .action(ArgAction::Set), ) .arg( Arg::new(options::RAW) - .long(options::RAW) - .help("emit a raw binary digest, not hexadecimal") - .action(ArgAction::SetTrue), + .long(options::RAW) + .help("emit a raw binary digest, not hexadecimal") + .action(ArgAction::SetTrue), ) .arg( Arg::new(options::BASE64) - .long(options::BASE64) - .help("emit a base64 digest, not hexadecimal") - .action(ArgAction::SetTrue) - // Even though this could easily just override an earlier '--raw', - // GNU cksum does not permit these flags to be combined: - .conflicts_with(options::RAW), + .long(options::BASE64) + .short('b') + .help("emit a base64 digest, not hexadecimal") + .action(ArgAction::SetTrue) + // Even though this could easily just override an earlier '--raw', + // GNU cksum does not permit these flags to be combined: + .conflicts_with(options::RAW), ) .after_help(AFTER_HELP) } diff --git a/tests/by-util/test_cksum.rs b/tests/by-util/test_cksum.rs index 818b7e799..71b32bdfa 100644 --- a/tests/by-util/test_cksum.rs +++ b/tests/by-util/test_cksum.rs @@ -379,13 +379,15 @@ fn test_base64_raw_conflicts() { #[test] fn test_base64_single_file() { for algo in ALGOS { - new_ucmd!() - .arg("--base64") - .arg("lorem_ipsum.txt") - .arg(format!("--algorithm={algo}")) - .succeeds() - .no_stderr() - .stdout_is_fixture_bytes(format!("base64/{algo}_single_file.expected")); + for base64_option in ["--base64", "-b"] { + new_ucmd!() + .arg(base64_option) + .arg("lorem_ipsum.txt") + .arg(format!("--algorithm={algo}")) + .succeeds() + .no_stderr() + .stdout_is_fixture_bytes(format!("base64/{algo}_single_file.expected")); + } } } #[test] diff --git a/tests/by-util/test_cut.rs b/tests/by-util/test_cut.rs index 50d158f96..86d3ddf0f 100644 --- a/tests/by-util/test_cut.rs +++ b/tests/by-util/test_cut.rs @@ -117,6 +117,17 @@ fn test_whitespace_with_char() { .code_is(1); } +#[test] +fn test_delimiter_with_byte_and_char() { + for conflicting_arg in ["-c", "-b"] { + new_ucmd!() + .args(&[conflicting_arg, COMPLEX_SEQUENCE.sequence, "-d="]) + .fails() + .stderr_is("cut: invalid input: The '--delimiter' ('-d') option only usable if printing a sequence of fields\n") + .code_is(1); + } +} + #[test] fn test_too_large() { new_ucmd!() @@ -289,6 +300,13 @@ fn test_multiple_mode_args() { } } +#[test] +fn test_no_argument() { + new_ucmd!().fails().stderr_is( + "cut: invalid usage: expects one of --fields (-f), --chars (-c) or --bytes (-b)\n", + ); +} + #[test] #[cfg(unix)] fn test_8bit_non_utf8_delimiter() {