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

Testing for Shorthand Lookup #128

Merged
merged 1 commit into from
May 5, 2017
Merged

Testing for Shorthand Lookup #128

merged 1 commit into from
May 5, 2017

Conversation

eparis
Copy link
Collaborator

@eparis eparis commented May 5, 2017

Update the example to make it clear that the string "verbose" is irrelevant to the lookup. (although still include the [:1] syntax).

Add some tests to shorthand lookup (len==0 and len >1)

Copy the Fprintf/panic pattern used on shorthand definition.

flag.go Outdated
@@ -327,7 +327,9 @@ func (f *FlagSet) ShorthandLookup(name string) *Flag {
return nil
}
if len(name) > 1 {
panic("can't look up for a shorthand with name more than one character")
msg := fmt.Sprintf("Can not look up shorthand which is more than one ASCII character: %q", name)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please use the lower-case ("can't look up...")

@eparis eparis force-pushed the shorthand-lookup branch from bf2b3d6 to 96dd079 Compare May 5, 2017 14:32
@eparis
Copy link
Collaborator Author

eparis commented May 5, 2017

fixed caps problem.

@n10v n10v merged commit 80fe0fb into spf13:master May 5, 2017
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