Skip to content

Commit

Permalink
add --ignore-cast-error flag
Browse files Browse the repository at this point in the history
  • Loading branch information
ret2end committed Jan 8, 2023
1 parent 86adec1 commit bad093d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion HKX2Library
10 changes: 5 additions & 5 deletions hkxconv/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,25 @@ static async Task<int> Main(string[] args)

var convertFormatOpt = new Option<ConvertFormat>(name: "-v", description: "Convert format.", getDefaultValue: () => ConvertFormat.xml);
var verboseOpt = new Option<bool>(name: "--verbose", description: "verbose", getDefaultValue: () => false);
//var ignoreErrorOpt = new Option<bool>(name: "--quiet", description: "ingore non-fatal error(content will be different from original)", getDefaultValue: () => false);
var ignoreErrorOpt = new Option<bool>(name: "--ignore-cast-error", description: "ignore fail to cast error(output will missing data. use with caution.)", getDefaultValue: () => false);
var inputDirArg = new Argument<FileSystemInfo>("Input dir or file");
var outputDirArg = new Argument<FileSystemInfo>("Output dir or file", getDefaultValue: () => new DirectoryInfo("."));

var convertCommand = new Command("convert", "Convert hkx file to other format")
{
convertFormatOpt,
verboseOpt,
//ignoreErrorOpt,
ignoreErrorOpt,
inputDirArg,
outputDirArg,
};

rootCommand.Add(convertCommand);

convertCommand.SetHandler((format, verbose, input, output) =>
convertCommand.SetHandler((format, verbose, ignoreErrorOpt, input, output) =>
{
cmd.Convert.ToFormat(input, output, format, verbose, false);
}, convertFormatOpt, verboseOpt, inputDirArg, outputDirArg);
cmd.Convert.ToFormat(input, output, format, verbose, ignoreErrorOpt);
}, convertFormatOpt, verboseOpt, ignoreErrorOpt, inputDirArg, outputDirArg);

return await rootCommand.InvokeAsync(args);
}
Expand Down

0 comments on commit bad093d

Please sign in to comment.