@@ -67,24 +67,6 @@ impl Matcher for SingleExecMatcher {
67
67
file_info. path ( ) . to_path_buf ( )
68
68
} ;
69
69
70
- // support interactive exec
71
- if self . interactive {
72
- let tips = format ! (
73
- "{} ... {} > ? [y/n]: " ,
74
- self . executable,
75
- path_to_file. to_string_lossy( )
76
- ) ;
77
- #[ allow( clippy:: explicit_write) ]
78
- write ! ( stdout( ) , "{}" , tips) . unwrap ( ) ;
79
- stdout ( ) . flush ( ) . unwrap ( ) ;
80
-
81
- let mut input = String :: new ( ) ;
82
- let _result = stdin ( ) . read_line ( & mut input) . unwrap ( ) ;
83
- if !input. trim ( ) . contains ( 'y' ) {
84
- return false ;
85
- }
86
- }
87
-
88
70
for arg in & self . args {
89
71
match * arg {
90
72
Arg :: LiteralArg ( ref a) => command. arg ( a. as_os_str ( ) ) ,
@@ -105,6 +87,25 @@ impl Matcher for SingleExecMatcher {
105
87
}
106
88
}
107
89
}
90
+
91
+ // support interactive exec
92
+ if self . interactive {
93
+ let tips = format ! (
94
+ "{} ... {} > ? [y/n]: " ,
95
+ self . executable,
96
+ path_to_file. to_string_lossy( )
97
+ ) ;
98
+ #[ allow( clippy:: explicit_write) ]
99
+ write ! ( stdout( ) , "{}" , tips) . unwrap ( ) ;
100
+ stdout ( ) . flush ( ) . unwrap ( ) ;
101
+
102
+ let mut input = String :: new ( ) ;
103
+ let _result = stdin ( ) . read_line ( & mut input) . unwrap ( ) ;
104
+ if !input. trim ( ) . contains ( 'y' ) {
105
+ return false ;
106
+ }
107
+ }
108
+
108
109
match command. status ( ) {
109
110
Ok ( status) => status. success ( ) ,
110
111
Err ( e) => {
0 commit comments