Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default-database positional CLI argument should be displayed as required #1738

Open
BenBirt opened this issue May 20, 2024 · 1 comment
Open

Comments

@BenBirt
Copy link
Collaborator

BenBirt commented May 20, 2024

➜  test_cli dataform init
Dataform encountered an error: The default-database positional argument is required. Use "dataform help init" for more info.
Error: The default-database positional argument is required. Use "dataform help init" for more info.
    at check (/usr/local/lib/node_modules/@dataform/cli/bundle.js:22191:39)
    at /usr/local/lib/node_modules/@dataform/cli/bundle.js:21382:33
    at Array.forEach (<anonymous>)
    at /usr/local/lib/node_modules/@dataform/cli/bundle.js:21382:16
    at Object.customChecks (/usr/local/lib/node_modules/@dataform/cli/node_modules/yargs/build/index.cjs:1572:26)
    at Object.runValidation [as _runValidation] (/usr/local/lib/node_modules/@dataform/cli/node_modules/yargs/build/index.cjs:2826:22)
    at Object.runCommand (/usr/local/lib/node_modules/@dataform/cli/node_modules/yargs/build/index.cjs:434:19)
    at Object.parseArgs [as _parseArgs] (/usr/local/lib/node_modules/@dataform/cli/node_modules/yargs/build/index.cjs:2697:57)
    at Object.get [as argv] (/usr/local/lib/node_modules/@dataform/cli/node_modules/yargs/build/index.cjs:2651:25)
    at runCli (/usr/local/lib/node_modules/@dataform/cli/bundle.js:22559:7)
➜  test_cli dataform help init                      
dataform init [project-dir] [default-database] [default-location]

Create a new dataform project.

Positionals:
  project-dir       The Dataform project directory.  [default: "."]
  default-database  The default database to use, equivalent to Google Cloud Project ID.
  default-location  The default location to use. See https://cloud.google.com/bigquery/docs/locations for supported values.

Options:
  --help     Show help  [boolean]
  --version  Show version number  [boolean]

default-database should be wrapped in angle brackets < and >, which will enable:

  1. easier understanding of how the CLI actually works from dataform help
  2. removal of the manual code check that enforces that it has been set
@BenBirt
Copy link
Collaborator Author

BenBirt commented May 20, 2024

ditto for default-location!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants