internal static RootCommand CreateCommand() { return(new RootCommand("Manages JSON Web Keys") { NewCommand.Create(), EncryptCommand.Create(), DecryptCommand.Create(), ConvertCommand.Create(), CheckCommand.Create() }); }
internal static Command Create() { var command = new DecryptCommand() .OptionalKeyValue("The key to encrypt") .OptionalInputPath("The plain key input path. Use this option when the key is stored into a file.") .OptionalPrivateKeyOutputPath() .RequiredEncryptionPassword() .Force() .Verbose(); return(command); }
private static async Task <int> Main(string[] args) { var rootCommand = new RootCommand("Manages JSON Web Keys") { NewCommand.Create(), EncryptCommand.Create(), DecryptCommand.Create(), ConvertCommand.Create(), CheckCommand.Create() }; Parser parser = BuildParser(rootCommand); // Parse the incoming args so we can give warnings when deprecated options are used. _parseResult = parser.Parse(args); ConsoleExtensions.IsVerbose = _parseResult.HasOption("--verbose"); return(await parser.InvokeAsync(args)); }