diff --git a/src/issue.ts b/src/issue.ts index bf80645a..e4fa73a2 100644 --- a/src/issue.ts +++ b/src/issue.ts @@ -61,15 +61,16 @@ async function getRepoIssues(repo: Repo, flags?: Flags): Promise { let use = true; if (flags) { - if (flags.api && r.api !== flags.api) { - use = false; + if (flags.api) { + const apiTypes = + flags.api.split(',').map(t => t.trim()).filter(t => t.length > 0); + if (!r.api || apiTypes.indexOf(r.api) === -1) { + use = false; + } } if (flags.repo && r.repo !== flags.repo) { use = false; } - if (flags.api && r.api !== flags.api) { - use = false; - } if (flags.outOfSlo && !r.isOutOfSLO) { use = false; } diff --git a/src/slo.ts b/src/slo.ts index 99de270b..c835e58f 100644 --- a/src/slo.ts +++ b/src/slo.ts @@ -66,7 +66,7 @@ function getRepoResults(repos: IssueResult[]) { return {repos: results, totals}; } -function getLanguageResults(repos: IssueResult[], api?: string) { +function getLanguageResults(repos: IssueResult[]) { const results = new Map(); const issues = new Array(); repos.forEach(r => { @@ -75,9 +75,6 @@ function getLanguageResults(repos: IssueResult[], api?: string) { if (isPullRequest(i)) { return; } - if (api && !isApi(i, api)) { - return; - } issues.push(i); }); }); @@ -430,7 +427,7 @@ export async function showApiSLOs(cli: meow.Result) { export async function showLanguageSLOs(cli: meow.Result) { const output = new Array(); const issues = await getIssues(cli.flags as Flags); - const res = getLanguageResults(issues, cli.flags.api); + const res = getLanguageResults(issues); const languageHeader = ['Language', 'Total', 'P0', 'P1', 'P2', 'Untriaged', 'Out of SLO']; let t2: Table;