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

Adding Usage and Titled interfaces #66

Closed
wants to merge 1 commit into from
Closed

Adding Usage and Titled interfaces #66

wants to merge 1 commit into from

Conversation

kenshaw
Copy link
Contributor

@kenshaw kenshaw commented Jun 15, 2018

Adds Usaged and Titled interfaces for allowing better flexibility for
controlling how command usage is displayed, and adds accompanying
documentation in README.md.

Adds Usaged and Titled interfaces for allowing better flexibility for
controlling how command usage is displayed, and adds accompanying
documentation in README.md.
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.8%) to 93.096% when pulling b6ed360 on kenshaw:add-usaged-and-titled-interfaces into f7c0423 on alexflint:master.

@alexflint
Copy link
Owner

alexflint commented Jun 19, 2018

Thanks for this pr @kenshaw. I'm somewhat hesitant to merge the change because I'm extremely keen to keep the API from growing, even though I understand this is mostly a transparent change. My instinct is to instead expand the Parser struct to support printing just the arguments and options, so that folks can customize the usage string more like this:

p, err := arg.NewParser(os.Args)
...
if err = p.Parse(&dest); err != nil {
  fmt.Println("Some title: some usage string")
  p.PrintPositionals()
  p.PrintArguments()
}

@kenshaw
Copy link
Contributor Author

kenshaw commented Jun 19, 2018

@alexflint OK -- thanks for the consideration. I thought you might be hesitant to add this. If there's something that can be changed in order to support this, let me know what I can do, and I'll gladly change it.

@alexflint alexflint closed this Oct 25, 2018
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

3 participants