File tree Expand file tree Collapse file tree 3 files changed +19
-11
lines changed Expand file tree Collapse file tree 3 files changed +19
-11
lines changed Original file line number Diff line number Diff line change @@ -1259,13 +1259,17 @@ fn parse_path_args(
1259
1259
return Err ( "missing file operand" . into ( ) ) ;
1260
1260
} else if paths. len ( ) == 1 && options. target_dir . is_none ( ) {
1261
1261
// Only one file specified
1262
- return Err ( format ! ( "missing destination file operand after {:?}" , paths[ 0 ] ) . into ( ) ) ;
1262
+ return Err ( format ! (
1263
+ "missing destination file operand after {}" ,
1264
+ paths[ 0 ] . display( ) . to_string( ) . quote( )
1265
+ )
1266
+ . into ( ) ) ;
1263
1267
}
1264
1268
1265
1269
// Return an error if the user requested to copy more than one
1266
1270
// file source to a file target
1267
1271
if options. no_target_dir && options. target_dir . is_none ( ) && paths. len ( ) > 2 {
1268
- return Err ( format ! ( "extra operand {:? }" , paths[ 2 ] ) . into ( ) ) ;
1272
+ return Err ( format ! ( "extra operand {:}" , paths[ 2 ] . display ( ) . to_string ( ) . quote ( ) ) . into ( ) ) ;
1269
1273
}
1270
1274
1271
1275
let target = match options. target_dir {
Original file line number Diff line number Diff line change @@ -84,7 +84,12 @@ pub(crate) fn copy_on_write(
84
84
// support COW).
85
85
match reflink_mode {
86
86
ReflinkMode :: Always => {
87
- return Err ( format ! ( "failed to clone {source:?} from {dest:?}: {error}" ) . into ( ) ) ;
87
+ return Err ( format ! (
88
+ "failed to clone {} from {}: {error}" ,
89
+ source. display( ) ,
90
+ dest. display( )
91
+ )
92
+ . into ( ) ) ;
88
93
}
89
94
_ => {
90
95
copy_debug. reflink = OffloadReflinkDebug :: Yes ;
Original file line number Diff line number Diff line change 2
2
//
3
3
// For the full copyright and license information, please view the LICENSE
4
4
// file that was distributed with this source code.
5
+
5
6
// spell-checker:ignore (flags) reflink (fs) tmpfs (linux) rlimit Rlim NOFILE clob btrfs neve ROOTDIR USERDIR procfs outfile uufs xattrs
6
7
// spell-checker:ignore bdfl hlsl IRWXO IRWXG nconfined matchpathcon libselinux-devel
7
- use uutests:: at_and_ucmd;
8
- use uutests:: new_ucmd;
9
- use uutests:: path_concat;
8
+ use uucore:: display:: Quotable ;
10
9
use uutests:: util:: TestScenario ;
11
- use uutests:: util_name;
10
+ use uutests:: { at_and_ucmd , new_ucmd , path_concat , util_name} ;
12
11
13
12
#[ cfg( not( windows) ) ]
14
13
use std:: fs:: set_permissions;
@@ -3946,10 +3945,10 @@ fn test_cp_only_source_no_target() {
3946
3945
let ts = TestScenario :: new ( util_name ! ( ) ) ;
3947
3946
let at = & ts. fixtures ;
3948
3947
at. touch ( "a" ) ;
3949
- ts. ucmd ( )
3950
- . arg ( "a" )
3951
- . fails ( )
3952
- . stderr_contains ( "missing destination file operand after \" a \" " ) ;
3948
+ ts. ucmd ( ) . arg ( "a" ) . fails ( ) . stderr_contains ( format ! (
3949
+ "missing destination file operand after {}" ,
3950
+ "a" . quote ( )
3951
+ ) ) ;
3953
3952
}
3954
3953
3955
3954
#[ test]
You can’t perform that action at this time.
0 commit comments