Skip to content
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
11 changes: 3 additions & 8 deletions src/uu/cksum/src/cksum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,6 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
return Err(ChecksumError::AlgorithmNotSupportedWithCheck.into());
}

let text_flag = matches.get_flag(options::TEXT);
let binary_flag = matches.get_flag(options::BINARY);
let tag = matches.get_flag(options::TAG);

if tag || binary_flag || text_flag {
return Err(ChecksumError::BinaryTextConflict.into());
}

// Execute the checksum validation based on the presence of files or the use of stdin

let verbose = ChecksumVerbose::new(status, quiet, warn);
Expand Down Expand Up @@ -251,6 +243,9 @@ pub fn uu_app() -> Command {
.short('c')
.long(options::CHECK)
.help(translate!("cksum-help-check"))
.conflicts_with(options::TAG)
.conflicts_with(options::BINARY)
.conflicts_with(options::TEXT)
.action(ArgAction::SetTrue),
)
.arg(
Expand Down
4 changes: 2 additions & 2 deletions tests/by-util/test_cksum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1216,7 +1216,7 @@ fn test_conflicting_options() {
.fails_with_code(1)
.no_stdout()
.stderr_contains(
"cksum: the --binary and --text options are meaningless when verifying checksums",
"cannot be used with", //clap generated error
);

scene
Expand All @@ -1228,7 +1228,7 @@ fn test_conflicting_options() {
.fails_with_code(1)
.no_stdout()
.stderr_contains(
"cksum: the --binary and --text options are meaningless when verifying checksums",
"cannot be used with", //clap generated error
);
}

Expand Down
Loading