split CLI modes to separate files
This commit is contained in:
@@ -14,26 +14,26 @@ try
|
||||
string? searchQuery = null;
|
||||
|
||||
new LaunchArgumentParser(
|
||||
new LaunchArgument(["-i", "--input"],
|
||||
"Set input file path",
|
||||
s => inputPath = s,
|
||||
"gamestate or zip file"),
|
||||
new LaunchArgument(["-i", "--input"],
|
||||
"Set input file path",
|
||||
s => inputPath = s,
|
||||
"gamestate or zip file"),
|
||||
|
||||
new LaunchArgument(["-o", "--output"],
|
||||
"Set output file path",
|
||||
s => outputPath = s,
|
||||
"json file [default=stdout]"),
|
||||
new LaunchArgument(["-o", "--output"],
|
||||
"Set output file path",
|
||||
s => outputPath = s,
|
||||
"json file [default=stdout]"),
|
||||
|
||||
new LaunchArgument(["-s", "--search"],
|
||||
"Search in input file",
|
||||
s =>
|
||||
{
|
||||
searchQuery = s;
|
||||
mode = Mode.Search;
|
||||
},
|
||||
"search expression")
|
||||
new LaunchArgument(["-s", "--search"],
|
||||
"Search in input file",
|
||||
s =>
|
||||
{
|
||||
searchQuery = s;
|
||||
mode = Mode.Search;
|
||||
},
|
||||
"search expression")
|
||||
)
|
||||
.WithNoExit()
|
||||
.AllowNoArguments()
|
||||
.ParseAndHandle(args);
|
||||
|
||||
if (args.Length == 0)
|
||||
@@ -57,6 +57,10 @@ try
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (LaunchArgumentParser.ExitAfterHelpException)
|
||||
{
|
||||
// this exception is throwed after -h argument to close the program
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ColoredConsole.WriteLine(ex.ToStringDemystified(), ConsoleColor.Red);
|
||||
|
||||
Reference in New Issue
Block a user