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

Customizable Help Functions #37

Merged
merged 3 commits into from
Oct 6, 2019
Merged

Conversation

densestvoid
Copy link
Contributor

Designed to begin addressing issue #29

HelpFunc added as field for Parsers and Commands
Parser HelpFunc defaults to Usage unless overwritten
Command HelpFunc defaults to first non nil parent HelpFunc unless overwritten

Design choice to enable backwards compatibility required
exposing Command and arg fields with Getter functions and an interface.

Does not resolve:
exiting program on help invocation
overwrritting/disabling -h | --help argument strings
enabling other argument strings to invoke help

Designed to begin addressing issue akamensky#29

HelpFunc added as field for Parsers and Commands
Parser HelpFunc defaults to Usage unless overwritten
Command HelpFunc defaults to first non nil parent HelpFunc

Design choice to enable backwards compatibility required
exposing Command and arg fields with Getter functions and an interface.

Does not resolve:
	exiting program on help invocation
	overwrritting/disabling -h | --help argument strings
	enabling other argument strings to invoke help
Copy link
Owner

@akamensky akamensky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@densestvoid thank you for PR. Appreciate the help on this one. I left some review comments there, specifically local imports are failing tests right now.

examples/help/help.go Outdated Show resolved Hide resolved
examples/command-help/commands-help.go Outdated Show resolved Hide resolved
argument.go Show resolved Hide resolved
argparse_test.go Outdated Show resolved Hide resolved
argparse.go Outdated Show resolved Hide resolved
argparse.go Outdated Show resolved Hide resolved
Resolving PR Changes
Fixed missed change from Command -> *Command as HelpFunc parameter
Examples may not pass until PR is intergrated into master, since it
includes new functions and fields
@densestvoid
Copy link
Contributor Author

Changes committed, all checks have passed

@akamensky akamensky self-requested a review October 6, 2019 14:25
@akamensky akamensky merged commit 1599c7c into akamensky:master Oct 6, 2019
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.

None yet

2 participants