@@ -212,7 +212,7 @@ public static void Init(string FeatureCollectionID, string ProductName = "CLUNL"
212
212
{
213
213
if ( Feature . FeatureCollectionID == FeatureCollectionID )
214
214
{
215
- features . Add ( Feature . Name . ToUpper ( ) , ( IFeature ) Activator . CreateInstance ( type ) ) ;
215
+ features . Add ( Feature . Name . ToUpper ( ) , ( IFeature ) Activator . CreateInstance ( type ) ) ;
216
216
infos . Add ( Feature . Name . ToUpper ( ) , Feature ) ;
217
217
}
218
218
}
@@ -227,7 +227,7 @@ public static void Init(string FeatureCollectionID, string ProductName = "CLUNL"
227
227
{
228
228
if ( Feature . FeatureCollectionID == FeatureCollectionID )
229
229
{
230
- VersionProvider = ( IFeatureCollectionVersion ) Activator . CreateInstance ( type ) ;
230
+ VersionProvider = ( IFeatureCollectionVersion ) Activator . CreateInstance ( type ) ;
231
231
}
232
232
}
233
233
}
@@ -283,53 +283,58 @@ public static void PrintHelp(string FeatureName)
283
283
OutLine ( FeatureDesc ) ;
284
284
OutLine ( ) ;
285
285
}
286
- OutLine ( "\t " + Language . Find ( "General.Console.Options" , "Options:" ) ) ;
287
- OutLine ( ) ;
288
- ParameterList p = new ParameterList ( ) ;
289
- p . ApplyDescription ( infos [ FeatureName ] ) ;
290
- Dictionary < string , List < string > > keyValuePairs = new Dictionary < string , List < string > > ( ) ;
291
- foreach ( var item in p . Parameters )
292
- {
293
- if ( keyValuePairs . ContainsKey ( item . Value ) )
294
- {
295
- keyValuePairs [ item . Value ] . Add ( item . Key ) ;
296
- }
297
- else
298
- {
299
- keyValuePairs . Add ( item . Value , new List < string > ( ) { item . Value } ) ;
300
- }
301
- }
302
- foreach ( var item in keyValuePairs )
303
- {
304
- Out ( "\t " ) ;
305
- for ( int i = 0 ; i < item . Value . Count ; i ++ )
286
+ if ( infos [ FeatureName ] . Options != null )
287
+ if ( infos [ FeatureName ] . OptionDescriptions != null )
306
288
{
307
- if ( i == 0 )
308
- {
309
- Out ( $ "-{ item . Value [ i ] } ") ;
310
- }
311
- else
312
- Out ( $ ", -{ item . Value [ i ] } ") ;
313
- }
314
- OutLine ( ) ;
315
- int index = - 1 ;
316
- for ( int i = 0 ; i < p . Options . Count ; i ++ )
317
- {
318
- if ( p . Options . ElementAt ( i ) . Key == item . Key )
289
+ OutLine ( "\t " + Language . Find ( "General.Console.Options" , "Options:" ) ) ;
290
+ OutLine ( ) ;
291
+ ParameterList p = new ParameterList ( ) ;
292
+ p . ApplyDescription ( infos [ FeatureName ] ) ;
293
+ Dictionary < string , List < string > > keyValuePairs = new Dictionary < string , List < string > > ( ) ;
294
+ foreach ( var item in p . Parameters )
319
295
{
320
- index = i ;
321
- break ;
296
+ if ( keyValuePairs . ContainsKey ( item . Value ) )
297
+ {
298
+ keyValuePairs [ item . Value ] . Add ( item . Key ) ;
299
+ }
300
+ else
301
+ {
302
+ keyValuePairs . Add ( item . Value , new List < string > ( ) { item . Value } ) ;
303
+ }
322
304
}
323
- }
324
- string fallback = "" ;
325
- if ( infos [ FeatureName ] . OptionDescriptions is not null )
326
- if ( infos [ FeatureName ] . OptionDescriptions . Length > 0 && index is not - 1 )
305
+ foreach ( var item in keyValuePairs )
327
306
{
328
- fallback = infos [ FeatureName ] . OptionDescriptions [ index ] ;
307
+ Out ( "\t " ) ;
308
+ for ( int i = 0 ; i < item . Value . Count ; i ++ )
309
+ {
310
+ if ( i == 0 )
311
+ {
312
+ Out ( $ "-{ item . Value [ i ] } ") ;
313
+ }
314
+ else
315
+ Out ( $ ", -{ item . Value [ i ] } ") ;
316
+ }
317
+ OutLine ( ) ;
318
+ int index = - 1 ;
319
+ for ( int i = 0 ; i < p . Options . Count ; i ++ )
320
+ {
321
+ if ( p . Options . ElementAt ( i ) . Key == item . Key )
322
+ {
323
+ index = i ;
324
+ break ;
325
+ }
326
+ }
327
+ string fallback = "" ;
328
+ if ( infos [ FeatureName ] . OptionDescriptions is not null )
329
+ if ( infos [ FeatureName ] . OptionDescriptions . Length > 0 && index is not - 1 )
330
+ {
331
+ fallback = infos [ FeatureName ] . OptionDescriptions [ index ] ;
332
+ }
333
+ OutLine ( $ "\t { Language . Find ( CurrentFeatureCollectionID + ".Options." + item . Key , fallback ) } ") ;
334
+
329
335
}
330
- OutLine ( $ "\t { Language . Find ( CurrentFeatureCollectionID + ".Options." + item . Key , fallback ) } ") ;
331
336
332
- }
337
+ }
333
338
}
334
339
/// <summary>
335
340
/// Print out localized version message.
@@ -533,7 +538,7 @@ public object Query(string KeyVariant)
533
538
/// <returns></returns>
534
539
public T Query < T > ( string KeyVariant )
535
540
{
536
- return ( T ) Options [ Parameters [ KeyVariant . ToUpper ( ) ] ] ;
541
+ return ( T ) Options [ Parameters [ KeyVariant . ToUpper ( ) ] ] ;
537
542
}
538
543
/// <summary>
539
544
/// Internal usage.
0 commit comments