less code in utility

This commit is contained in:
Chris Forbes
2011-10-04 22:36:30 +13:00
parent 2df7a657d3
commit e5a1658d87

View File

@@ -33,11 +33,8 @@ namespace OpenRA.Utility
try try
{ {
var action = Exts.WithDefault( null, () => actions[args[0]]); var action = Exts.WithDefault( _ => PrintUsage(), () => actions[args[0]]);
if (action == null) action(args);
PrintUsage();
else
action(args);
} }
catch( Exception e ) catch( Exception e )
{ {