@@ -76,13 +76,6 @@ public SearchCommand()
7676 Query = SearchQuery . Null ;
7777 }
7878
79- public override ValidationResult Validate ( CommandContext context , SearchCommandSettings settings )
80- {
81- var r = base . Validate ( context , settings ) ;
82- return r ;
83-
84- }
85-
8679 private async void OnComplete ( object sender , SearchResult [ ] searchResults )
8780 {
8881 // pt1.Increment(COMPLETE);
@@ -219,25 +212,8 @@ public override async Task<int> ExecuteAsync(CommandContext context, SearchComma
219212
220213 await task ;
221214
222- var dt = new Grid ( ) ;
223- dt . AddColumns ( 2 ) ;
224-
225- var kv = new Dictionary < string , object > ( )
226- {
227- [ R1 . S_SearchEngines ] = Config . SearchEngines ,
228- [ R1 . S_PriorityEngines ] = Config . PriorityEngines ,
229- [ R1 . S_AutoSearch ] = Config . AutoSearch ,
230- [ R1 . S_ReadCookies ] = Config . ReadCookies ,
231-
232- [ "Input" ] = Query
233- } ;
234-
235- foreach ( var o in kv ) {
236- dt . AddRow ( new Text ( o . Key , CliFormat . Sty_Grid1 ) ,
237- new Text ( o . Value . ToString ( ) ) ) ;
238- }
239-
240- AConsole . Write ( dt ) ;
215+ var gr = CreateInfoGrid ( ) ;
216+ AConsole . Write ( gr ) ;
241217
242218 // AConsole.WriteLine($"Input: {Query}");
243219
@@ -260,6 +236,30 @@ public override async Task<int> ExecuteAsync(CommandContext context, SearchComma
260236 act = await RunSimpleAsync ( ) ;
261237
262238 return ( int ) act ;
239+
240+ }
241+
242+ private Grid CreateInfoGrid ( )
243+ {
244+ var dt = new Grid ( ) ;
245+ dt . AddColumns ( 2 ) ;
246+
247+ var kv = new Dictionary < string , object > ( )
248+ {
249+ [ R1 . S_SearchEngines ] = Config . SearchEngines ,
250+ [ R1 . S_PriorityEngines ] = Config . PriorityEngines ,
251+ [ R1 . S_AutoSearch ] = Config . AutoSearch ,
252+ [ R1 . S_ReadCookies ] = Config . ReadCookies ,
253+
254+ [ "Input" ] = Query
255+ } ;
256+
257+ foreach ( var o in kv ) {
258+ dt . AddRow ( new Text ( o . Key , CliFormat . Sty_Grid1 ) ,
259+ new Text ( o . Value . ToString ( ) ) ) ;
260+ }
261+
262+ return dt ;
263263 }
264264
265265 private async Task < int > RunSimpleAsync ( )
@@ -271,7 +271,7 @@ private async Task<int> RunSimpleAsync()
271271 var cnt = ( double ) Client . Engines . Length ;
272272 var pt = c . AddTask ( "Running search" , maxValue : cnt ) ;
273273 pt . IsIndeterminate = true ;
274-
274+
275275 // var p2 = c.AddTask("Engines", maxValue: cnt);
276276
277277 // Client.OnResult += OnResultComplete;
@@ -301,6 +301,13 @@ private async Task<int> RunSimpleAsync()
301301 return EC_OK ;
302302 }
303303
304+ public override ValidationResult Validate ( CommandContext context , SearchCommandSettings settings )
305+ {
306+ var r = base . Validate ( context , settings ) ;
307+ return r ;
308+
309+ }
310+
304311 public void Dispose ( )
305312 {
306313 foreach ( var sr in m_results ) {
0 commit comments