// TODO: this is gross, refactor it to something... private void ParseExecCmd(ExecCmd baseCmd) { var execService = new ExecService(GetActiveProfile()); var parser = new Parser(with => with.HelpWriter = null); var parserResult = parser.ParseArguments <ExecCl, ExecShell, ExecSql>(baseCmd.SubArgs); parserResult .WithParsed <ExecCl>(args => execService.ExecCL(args.ClCmd)) .WithParsed <ExecShell>(args => execService.ExecShell(args.ShellCmd)) .WithParsed <ExecSql>(args => execService.ExecSql(args.SqlCmd)) .WithNotParsed(_ => WriteHelpText(parserResult)); }
public ContainerController(ILogger <ContainerController> logger, ContainerService service, ExecService execService) { _logger = logger; _service = service; _execService = execService; }