Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix wierd interactions due to Cobra and glog
The glog package force the use of golang's underyling flag package, which Cobra does not use. To work around this, we had a complicated dance around defining flags in multiple places, calling flag.Parse explicitly and then stomping values in the flag package with values we got from Cobra. Because we ended up parsing parts of the command line twice, each with a different set of semantics, we ended up with bad UX in some cases. For example: `$ pulumi -v=10 --logflow update` Would fail with an error message that looked nothing like normal CLI errors, where as: `$ pulumi -v=10 update --logflow` Would behave as you expect. To address this, we now do two things: - We never call flag.Parse() anymore. Wacking the flags with values we got from Cobra is sufficent for what we care about. - We use a forked copy of glog which does not complain when flag.Parse() is not called before logging. Fixes #301 Fixes #710 Fixes #968
- Loading branch information
Showing
5 changed files
with
12 additions
and
14 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters