You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some UDCs (or even targets) could benefit from strictly required ARGs - ARGs that must be passed in, in order for the command (or target) to work.
This helps eliminate cases where the user is chasing their tail trying to figure out what's wrong when an ARG is unexpectedly set to "" when declared as ARG something and no value is provided on the call itself.
then, under func (i *Interpreter) handleArg(ctx context.Context, cmd spec.Command) error {, one would have to reference the struct to parse the opts. then if the required flag is set, check the value is not empty.
* Implement Required ARGs #904
* File cannot have default value for --required args
* Allow optional flag for ARG in earthfile syntax
* Error if build-arg not provided for required ARG
Minimal behavior verification test: https://asciinema.org/a/441110
* Add feature test and update ARG docs
* Implement Required ARGs #904
* File cannot have default value for --required args
* Allow optional flag for ARG in earthfile syntax
* Error if build-arg not provided for required ARG
Minimal behavior verification test: https://asciinema.org/a/441110
* Add feature test and update ARG docs
* Add test that args are required, move file after rebase
* Update required-args.earth
Remove double newline, add newline at end of required-args.earth for linter
Some UDCs (or even targets) could benefit from strictly required ARGs - ARGs that must be passed in, in order for the command (or target) to work.
This helps eliminate cases where the user is chasing their tail trying to figure out what's wrong when an ARG is unexpectedly set to
""
when declared asARG something
and no value is provided on the call itself.Sytanx suggestion:
Required ARGs can never have a default value.
CC @jazzdan
The text was updated successfully, but these errors were encountered: