diff --git a/README.md b/README.md index 0bb610d..f2277b5 100644 --- a/README.md +++ b/README.md @@ -47,12 +47,14 @@ For all actions, the tool will ask you to input a GitHub token. To obtain this t ## Other Options -| Option | Notes | -| ----------------------- | ---------------------------------------------------- | -| -V, --version | output the version number | -| -g, --github_enterprise | Your GitHub Enterprise URL. | -| -t, --token | The GitHub token. https://github.com/settings/tokens | -| -h, --help | See all the options and help. | +| Option | Notes | +| ----------------------- | -------------------------------------------------------- | +| -V, --version | output the version number | +| -g, --github_enterprise | Your GitHub Enterprise URL. | +| -t, --token | The GitHub token. https://github.com/settings/tokens | +| -o, --organization | The User or Organization slug that the repo lives under. | +| -r, --repository | The repository name (slug). | +| -h, --help | See all the options and help. | ## Development diff --git a/index.js b/index.js index 122187e..71f1609 100644 --- a/index.js +++ b/index.js @@ -21,6 +21,11 @@ program "-t, --token [token]", "The GitHub token. https://github.com/settings/tokens" ) + .option( + "-o, --organization [organization]", + "The User or Organization slug that the repo lives under." + ) + .option("-r, --repository [repository]", "The repository name (slug).") .option( "-f, --exportFileName [export.csv]", "The name of the CSV you'd like to export to." @@ -49,8 +54,16 @@ program .map((i) => i.trim()); } retObject.exportComments = options.exportComments || false; - retObject.userOrOrganization = yield prompt("user or organization: "); - retObject.repo = yield prompt("repo: "); + + retObject.userOrOrganization = options.organization || ""; + if (retObject.userOrOrganization === "") { + retObject.userOrOrganization = yield prompt("user or organization: "); + } + + retObject.repo = options.repository || ""; + if (retObject.repo === "") { + retObject.repo = yield prompt("repository: "); + } return retObject; }).then( function (values) {