dataform-co / dataform

Dataform is a framework for managing SQL based data operations in BigQuery
https://cloud.google.com/dataform/docs
Apache License 2.0
810 stars 151 forks source link

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

Open BenBirt opened 2 months ago

BenBirt commented 2 months ago
➜  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 commented 2 months ago

ditto for default-location!