From 31afbfc18105e5b297acb4083f058d31182897e8 Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Fri, 27 Sep 2024 12:49:24 +0200 Subject: [PATCH] ref: Add `--project` and `--org` args to help message and update readme (#679) Add the `project` and `org` CLI args to the `--help` message. update the outdated readme with all current CLI args and reformats the previous CLI output into a table --- CHANGELOG.md | 1 + README.md | 41 ++++++++++++++++++----------------------- bin.ts | 15 ++++++++++++++- 3 files changed, 33 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a3cf70a..a3d2502f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Unreleased - feat: Add `--saas` CLI arg to skip self-hosted or SaaS selection step (#678) +- ref: Add `--project` and `--org` args to help message and update readme (#679) ## 3.31.0 diff --git a/README.md b/README.md index d711e340..c46934b3 100644 --- a/README.md +++ b/README.md @@ -53,29 +53,24 @@ At the current moment, the wizard is meant to be used for React Native, Cordova, # Options -``` -Options: - --help Show help [boolean] - --version Show version number [boolean] - --debug Enable verbose logging - env: SENTRY_WIZARD_DEBUG [boolean] - --uninstall Revert project set up process - env: SENTRY_WIZARD_UNINSTALL [boolean] - --skip-connect Skips the connection to the server - env: SENTRY_WIZARD_SKIP_CONNECT [boolean] - --quiet Do not fallback to prompting user asking questions - env: SENTRY_WIZARD_QUIET [boolean] - -i, --integration Choose the integration to set up - env: SENTRY_WIZARD_INTEGRATION - [choices: "reactNative", "cordova", "electron", "nextjs"] - -p, --platform Choose platform(s) - env: SENTRY_WIZARD_PLATFORM - [array] [choices: "ios", "android"] - -u, --url The url to your Sentry installation - env: SENTRY_WIZARD_URL [default: "https://sentry.io/"] - -s, --signup Redirect to signup page if not logged in - Use if don't have a Sentry account [boolean] -``` +The following CLI arguments are available: + +| Option | Description | Type | Default | Choices | Environment Variable | +| --------------------- | ----------------------------------------------------------------- | ------- | --------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------- | +| `--help` | Show help | boolean | | | | +| `--version` | Show version number | boolean | | | | +| `--debug` | Enable verbose logging | boolean | `false` | | `SENTRY_WIZARD_DEBUG` | +| `--uninstall` | Revert project setup process. Not available for all integrations. | boolean | `false` | | `SENTRY_WIZARD_UNINSTALL` | +| `--skip-connect` | Skips the connection to the server | boolean | `false` | | `SENTRY_WIZARD_SKIP_CONNECT` | +| `--quiet` | Do not fallback to prompting user asking questions | boolean | `false` | | `SENTRY_WIZARD_QUIET` | +| `-i, --integration` | Choose the integration to setup | choices | Select integration during setup | "reactNative", "ios", "android", "cordova", "electron", "nextjs", "remix", "sveltekit", "sourcemaps" | `SENTRY_WIZARD_INTEGRATION` | +| `-p, --platform` | Choose platform(s) | array | Select platform(s) during setup | "ios", "android" | `SENTRY_WIZARD_PLATFORM` | +| `-u, --url` | The URL to your Sentry installation | string | `https://sentry.io` | | `SENTRY_WIZARD_URL` | +| `--project` | The Sentry project slug to use | string | Select project during setup | | | +| `--org` | The Sentry org slug to use | string | Select org during setup | | | +| `--saas` | Skip the self-hosted or SaaS URL selection process | boolean | Select self-hosted or SaaS during setup | | | +| `-s, --signup` | Redirect to signup page if not logged in | boolean | `false` | | | +| `--disable-telemetry` | Don't send telemetry data to Sentry | boolean | `false` | | | ## Resources diff --git a/bin.ts b/bin.ts index d72973d4..0d13e4dc 100644 --- a/bin.ts +++ b/bin.ts @@ -60,9 +60,22 @@ const argv = yargs(hideBin(process.argv)) alias: 'url', describe: 'The url to your Sentry installation\nenv: SENTRY_WIZARD_URL', }) + .option('project', { + type: 'string', + describe: 'The Sentry project slug to use', + defaultDescription: 'Select project during setup', + default: undefined, + }) + .option('org', { + type: 'string', + describe: 'The Sentry org slug to use', + defaultDescription: 'Select org during setup', + default: undefined, + }) .option('saas', { default: false, - describe: 'If set, skip the self-hosted or SaaS URL selection process', + describe: 'Skip the self-hosted or SaaS URL selection process', + defaultDescription: 'Select self-hosted or SaaS during setup', type: 'boolean', }) .option('s', {