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

parse flags #2

Closed
wants to merge 2 commits into from
Closed

parse flags #2

wants to merge 2 commits into from

Conversation

mxmxchere
Copy link
Contributor

  • Make version a flag, otherwise the other flags are not parsed correctly
  • Rename manifest variable that holds index to index

@nkraetzschmar
Copy link
Contributor

what exactly is the problem with parsing the other flags when version is a positional arg? Parsing worked fine in my tests.

If there is no good reason I'd prefer keeping version as a positional arg since it is the only required flag and in almost all cases this is the only one that should be provided. All others are only for special corner cases to overwrite the defaults.

For 99% of use cases the update tool will probably be called simply as gardenlinux-update {version}, so always requiring to call it as gardenlinux-update --version {version} would be undesirable.

@mxmxchere
Copy link
Contributor Author

I should have read the docs of flag.Arg and flag.NArg. They are referring to args that are left after flags are parsed. I thought they refer to the strict index command line arguments are supplied with. My mistake, this PR is no longer needed.

@mxmxchere mxmxchere closed this Nov 26, 2024
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

Successfully merging this pull request may close these issues.

2 participants