Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change ec validate input to use positional arguments #1313

Open
lcarva opened this issue Jan 30, 2024 · 0 comments
Open

Change ec validate input to use positional arguments #1313

lcarva opened this issue Jan 30, 2024 · 0 comments

Comments

@lcarva
Copy link
Member

lcarva commented Jan 30, 2024

The ec validate input should take positional arguments instead of named arguments for the list of files to validate, i.e. ec validate input spam.yaml instead of ec validate input --file spam.yaml

Why? Because of all the arguments that command accepts, the input files are likely the thing to have a variable length. Consider the case where you have a bunch of yaml files in a directory. Assuming a shell is being used, positional arguments would look like ec validate input *.yaml, and named parameter like ec validate input $(find . -name '*.yaml' -printf '--file=%p ') . The second version relies on the find utility which may not be available in some contexts.

See cobra's docs on positional arguments.

Acceptance Criteria

  • Change ec validate input to take positional arguments. Each is treated as a file to be validated.
  • For backwards compatibility, continue to accept the --file parameter, but be sure to mark it as deprecated. If both --file and positional arguments are provided, combine the values.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant