Skip to content

[dev/run/logLevels] flags are bools, don't capture values - #33528

Merged
spalger merged 1 commit into
elastic:masterfrom
spalger:fix/dev-run-log-flags
Mar 19, 2019
Merged

spalger merged 1 commit into
elastic:masterfrom
spalger:fix/dev-run-log-flags

Conversation

@spalger

@spalger spalger commented Mar 19, 2019 •

Copy link
Copy Markdown
Contributor

Calling a script that uses the dev/run helpers with the default log level flags, like --debug, sets the log level of the internal tooling log. These flags all default to false so that getopts doesn't think they are unexpected, but that doesn't tell getopts to treat them as boolean flags which causes problems when using "naked" arguments like so:

# sets debug flag to foo
node scripts/my_script --debug foo
# sets debug flag to true and include `foo` in `_` flags
node scripts/my_script foo --debug 

This ordering restriction makes for fragile scripts and can be fixed by telling getopts to treat the logging flags as booleans (which defaults them to false anyway).

@spalger
spalger requested a review from jbudz March 19, 2019 18:34
@elasticmachine

Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-operations

@elasticmachine

Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@spalger

spalger commented Mar 22, 2019

Copy link
Copy Markdown
Contributor Author

7.x/7.1: 0b48666
7.0: 345809e

@spalger
spalger deleted the fix/dev-run-log-flags branch March 22, 2019 00:04
patrykkopycinski pushed a commit to patrykkopycinski/kibana that referenced this pull request May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants