private static int Execute <TOptions>( AbstractCommand <TOptions> command, AbstractCommandLineOptions options) where TOptions : AbstractCommandOptions { #if DEBUG if (ShouldLog(Verbosity.Diagnostic)) { WriteLine("--- RAW PARAMETERS ---", Verbosity.Diagnostic); DiagnosticWriter.WriteParameters(options); WriteLine("--- END OF RAW PARAMETERS ---", Verbosity.Diagnostic); WriteLine("--- APP PARAMETERS ---", Verbosity.Diagnostic); command.Options.WriteDiagnostic(); WriteLine("--- END OF APP PARAMETERS ---", Verbosity.Diagnostic); } #endif CommandResult result = command.Execute(); switch (result) { case CommandResult.Success: return(ExitCodes.Match); case CommandResult.NoMatch: return(ExitCodes.NoMatch); case CommandResult.Fail: case CommandResult.Canceled: return(ExitCodes.Error); default: throw new InvalidOperationException($"Unknown enum value '{result}'."); } }
protected override void WriteDiagnosticCore() { DiagnosticWriter.WriteRenameCommand(this); }
protected override void WriteDiagnosticCore() { DiagnosticWriter.WriteListPatternsCommand(this); }