Using declarations and other code reformats

This commit is contained in:
Kwoth
2021-12-26 03:22:45 +01:00
parent d18f9429c6
commit b85ba177cd
64 changed files with 2349 additions and 2736 deletions

View File

@@ -9,15 +9,13 @@ public static class OptionsParser
public static (T, bool) ParseFrom<T>(T options, string[] args) where T : INadekoCommandOptions
{
using (var p = new Parser(x =>
{
x.HelpWriter = null;
}))
using var p = new Parser(x =>
{
var res = p.ParseArguments<T>(args);
options = res.MapResult(x => x, x => options);
options.NormalizeOptions();
return (options, res.Tag == ParserResultType.Parsed);
}
x.HelpWriter = null;
});
var res = p.ParseArguments<T>(args);
options = res.MapResult(x => x, x => options);
options.NormalizeOptions();
return (options, res.Tag == ParserResultType.Parsed);
}
}