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

Add global option #2

Merged
merged 1 commit into from
Jul 4, 2023
Merged

Add global option #2

merged 1 commit into from
Jul 4, 2023

Conversation

corka149
Copy link
Contributor

@corka149 corka149 commented Jul 4, 2023

(It was much simpler to create a new merge request for the new repo 😄 )

This PR should implement funbox/optimus#11.

The current implementation merges global options/flags into all subcommands. On this way collisions can be detected (in case someone tries to redefine a property with the same short/long). In addition, every subcommand is a complete definition which makes parsing of global props easy.

Also I implemented hiding of properties in the same PR because it is used to hide global props in the subcommands. I know some CLI tools like kubectl that do not repeat global properties on the subcommands.

@coveralls
Copy link

Coverage Status

coverage: 90.72% (+0.4%) from 90.354% when pulling 9993af2 on corka149:master into 4e5b137 on savonarola:master.

@savonarola savonarola merged commit cbb3280 into savonarola:master Jul 4, 2023
@savonarola
Copy link
Owner

Thanks!

@savonarola
Copy link
Owner

https://hex.pm/packages/optimus/0.5.0

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.

3 participants