@@ -118,8 +118,20 @@ impl Phone {
118118 }
119119 return Some ( Action :: TimedStatusLine ( "invalid response args. response save <payload-file-name>" . into ( ) , 3 ) ) ;
120120 }
121+ if let Some ( expr) = command_args. strip_prefix ( "jq " ) {
122+ return Some ( Action :: ApplyJqQuery ( expr. trim ( ) . to_string ( ) ) ) ;
123+ }
124+ if command_args. eq ( "jq" ) {
125+ return Some ( Action :: ApplyJqQuery ( String :: new ( ) ) ) ;
126+ }
127+ if let Some ( term) = command_args. strip_prefix ( "search " ) {
128+ return Some ( Action :: ApplySearch ( term. trim ( ) . to_string ( ) ) ) ;
129+ }
130+ if command_args. eq ( "search" ) {
131+ return Some ( Action :: ApplySearch ( String :: new ( ) ) ) ;
132+ }
121133 Some ( Action :: TimedStatusLine (
122- "unknown command. available commands are: send, query, header, request, response" . into ( ) ,
134+ "unknown command. available commands are: send, query, header, request, response, jq, search " . into ( ) ,
123135 3 ,
124136 ) )
125137 }
@@ -238,11 +250,12 @@ impl Page for Phone {
238250 pane. update ( Action :: Focus , state) ?;
239251 }
240252 if let Some ( action) = self . handle_commands ( args) {
241- for pane in self . panes . iter_mut ( ) {
242- actions. push ( pane. update ( action. clone ( ) , state) ?) ;
243- }
244253 if let Action :: TimedStatusLine ( _, _) = action {
245- actions. push ( Some ( action) )
254+ actions. push ( Some ( action) ) ;
255+ } else {
256+ for pane in self . panes . iter_mut ( ) {
257+ actions. push ( pane. update ( action. clone ( ) , state) ?) ;
258+ }
246259 }
247260 }
248261 } ,
0 commit comments