private static ICommand ParseCommand(string commandName, string[] args, StreamReader operationsFileReader) { return(commandName switch { ReadCommandName => ReadCommand.ParseCommandLine(args), WriteCommandName => WriteCommand.ParseCommandLine(args), ListServerCommandName => ListServerCommand.ParseCommandLine(args), ListGlobalCommandName => ListGlobalCommand.ParseCommandLine(args), WaitCommandName => WaitCommand.ParseCommandLine(args), BeginRepeatCommandName => BeginRepeatCommand.ParseCommandLine(args, operationsFileReader), _ => null });
private static ICommand ParseCommand(string commandName, string[] args) { return(commandName switch { ReplicationFactorCommandName => ReplicationFactorCommand.ParseCommandLine(args), ServerCommandName => ServerCommand.ParseCommandLine(args), PartitionCommandName => PartitionCommand.ParseCommandLine(args), ClientCommandName => ClientCommand.ParseCommandLine(args), StatusCommandName => StatusCommand.ParseCommandLine(args), CrashRepeatCommandName => CrashRepeatCommand.ParseCommandLine(args), FreezeRepeatCommandName => FreezeRepeatCommand.ParseCommandLine(args), UnfreezeRepeatCommandName => UnfreezeRepeatCommand.ParseCommandLine(args), WaitCommandName => WaitCommand.ParseCommandLine(args), _ => throw new Exception("Command not found") });