Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This reworks the flags feature and refactors a lot of the code under the hood
to change the design and fix some issues.
Fix the --help issue.
Previously, --help didn't work at all and resulted in an error:
pflag: help requested
(see--help
prints "pflag: help requested" #1). This fixes that issue and also improves the printing ofuser flags in the --help text. User flags are now shown at the bottom,
separate from builtin and global astro flags. E.g.:
Previously, Terraform variable names were remapped to a different flag name
by specifying the
flag:
option in the variable config, e.g.:This meant if you had many modules defined with the same variable, you had to
type out the mapping correctly every time or else you would get an error.
The mapping configuration has now moved to its own block in the project
config, which now looks like:
Users can now also specify a description that will appear in the --help text.
Note that the flags section is completely optional, and be default astro will
just expose the full variable name as the CLI flag.
Refactoring
The implementation of user/project flags did a lot of the error checking in
the cli/astro package itself, however, we want to move in a direction where
those checks occur in the core astro package. The CLI should be a thin
wrapper around the core package.
Because this results in a breaking change in the config, I'm going to bump
this to 0.5.0.