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

Bbkane/parse2 #81

Merged
merged 20 commits into from
Jan 6, 2025
Merged

Bbkane/parse2 #81

merged 20 commits into from
Jan 6, 2025

Conversation

bbkane
Copy link
Owner

@bbkane bbkane commented Jan 6, 2025

v0.0.26

Changed

  • Moved SetBy into the Value interface (value.UpdatedBy() - this allows
    Flag to be readonly and and makes the coupling between setting the value and
    updating UpdatedBy explicit
  • Flags must now be the last things passed - i.e. <appname> <section> <command> <flag>.... In addition, the only flag allowed after a <section> is
    the --help flag (unfortunately the --color flag is NOT currently allowed to
    be passed for section help). This simplifies the parsing and will help with tab
    completion, and after that's implemented I might try to restore the old
    behavior if I get too annoyed with this limitation. Temporarily, the old
    behavior can be restored by setting the WARG_PRE_V0_0_26_PARSE_ALGORITHM
    environment variable, but I plan to remove that in the next version.

Examples:

$ go run ./examples/butler --color false -h
Parse err: Parse args error: expecting section or command, got --color
exit status 64
$ WARG_PRE_V0_0_26_PARSE_ALGORITHM=1 go run ./examples/butler --color false -h
A virtual assistant
# ... more text ...

@bbkane bbkane merged commit 305b9fc into master Jan 6, 2025
1 check passed
@bbkane bbkane deleted the bbkane/parse2 branch January 6, 2025 14:27
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.

1 participant