public override Action <CommandLineApplication> GetConfiguration(CommandLineApplication app) { return((command) => { command.Description = Description; SetHelpOption(command); SetApiTokenOption(command); var accountNameOption = SetOption(command, new AccountName()); var projectSlugOption = SetOption(command, new ProjectSlug()); var versionOption = command.Option("--version", "The build version", CommandOptionType.SingleValue); command.OnExecute(() => { return RunRequest(command, app, () => { if (versionOption.HasValue()) { return ClientFactory.GetClient(ApiTokenOption.Value()) .ProjectApiClient .GetProjectBuildByVersion(ClientFactory.GetUserAgent(app), accountNameOption.Value(), projectSlugOption.Value(), versionOption.Value()) .Result; } else { return ClientFactory.GetClient(ApiTokenOption.Value()) .ProjectApiClient .GetProjectLastBuild(ClientFactory.GetUserAgent(app), accountNameOption.Value(), projectSlugOption.Value()) .Result; } } ); }); }); }
public override Action <CommandLineApplication> GetConfiguration(CommandLineApplication app) { return((command) => { command.Description = Description; SetHelpOption(command); SetApiTokenOption(command); var accountNameOption = SetOption(command, new AccountName()); var projectSlugOption = SetOption(command, new ProjectSlug()); var yamlOption = command.Option("--yaml", "Get as YAML", CommandOptionType.NoValue); command.OnExecute(() => { return RunRequest(command, app, () => { if (yamlOption.HasValue()) { return ClientFactory.GetClient(ApiTokenOption.Value()) .ProjectApiClient .GetProjectSettingsYaml(ClientFactory.GetUserAgent(app), accountNameOption.Value(), projectSlugOption.Value()) .Result; } else { return ClientFactory.GetClient(ApiTokenOption.Value()) .ProjectApiClient .GetProjectSettings(ClientFactory.GetUserAgent(app), accountNameOption.Value(), projectSlugOption.Value()) .Result; } } ); }); }); }
public override Action <CommandLineApplication> GetConfiguration(CommandLineApplication app) { return((command) => { command.Description = Description; SetHelpOption(command); SetApiTokenOption(command); command.OnExecute(() => { return RunRequest(command, app, () => { return ClientFactory.GetClient(ApiTokenOption.Value()).ProjectApiClient.GetProjects(ClientFactory.GetUserAgent(app)).Result; } ); }); }); }