File tree Expand file tree Collapse file tree 2 files changed +5
-10
lines changed
Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -134,14 +134,6 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
134134 return Err ( ChecksumError :: AlgorithmNotSupportedWithCheck . into ( ) ) ;
135135 }
136136
137- let text_flag = matches. get_flag ( options:: TEXT ) ;
138- let binary_flag = matches. get_flag ( options:: BINARY ) ;
139- let tag = matches. get_flag ( options:: TAG ) ;
140-
141- if tag || binary_flag || text_flag {
142- return Err ( ChecksumError :: BinaryTextConflict . into ( ) ) ;
143- }
144-
145137 // Execute the checksum validation based on the presence of files or the use of stdin
146138
147139 let verbose = ChecksumVerbose :: new ( status, quiet, warn) ;
@@ -251,6 +243,9 @@ pub fn uu_app() -> Command {
251243 . short ( 'c' )
252244 . long ( options:: CHECK )
253245 . help ( translate ! ( "cksum-help-check" ) )
246+ . conflicts_with ( options:: TAG )
247+ . conflicts_with ( options:: BINARY )
248+ . conflicts_with ( options:: TEXT )
254249 . action ( ArgAction :: SetTrue ) ,
255250 )
256251 . arg (
Original file line number Diff line number Diff line change @@ -1216,7 +1216,7 @@ fn test_conflicting_options() {
12161216 . fails_with_code ( 1 )
12171217 . no_stdout ( )
12181218 . stderr_contains (
1219- "cksum: the --binary and --text options are meaningless when verifying checksums" ,
1219+ "cannot be used with" , //clap generated error
12201220 ) ;
12211221
12221222 scene
@@ -1228,7 +1228,7 @@ fn test_conflicting_options() {
12281228 . fails_with_code ( 1 )
12291229 . no_stdout ( )
12301230 . stderr_contains (
1231- "cksum: the --binary and --text options are meaningless when verifying checksums" ,
1231+ "cannot be used with" , //clap generated error
12321232 ) ;
12331233}
12341234
You can’t perform that action at this time.
0 commit comments