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

Allow user defined help string at CommandSpec.add_help() #2535

Merged
merged 2 commits into from
Feb 21, 2018

Conversation

Sleeplessy
Copy link
Contributor

@Sleeplessy Sleeplessy commented Feb 6, 2018

In package cli at command_spec.pony:

  • Original add_help() function always adds a help option with an empty description
  • I add a parameter that allows to modify the standard help option's description while using add_help

@@ -79,12 +80,13 @@ class CommandSpec
if _args.size() > 0 then error end
_commands.update(cmd.name(), cmd)

fun ref add_help(hname: String = "help") ? =>
fun ref add_help(hname: String = "help", hinfo: String = "Print help page") ? =>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe i should leave this default to empty

Copy link
Contributor

Choose a reason for hiding this comment

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

i'd suggest to rename hinfo to descr' to accomodate to the API of OptionSpec and maybe keep a default one of display this help and exit.

Copy link
Member

Choose a reason for hiding this comment

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

It should default to empty for this to be considered a "non-breaking change".

@jemc jemc added the changelog - added Automatically add "Added" CHANGELOG entry on merge label Feb 21, 2018
@jemc jemc merged commit 9d7c178 into ponylang:master Feb 21, 2018
ponylang-main added a commit that referenced this pull request Feb 21, 2018
@mfelsche
Copy link
Contributor

Thank you very much!

@Sleeplessy Sleeplessy deleted the add_help_info branch February 24, 2018 13:24
dipinhora pushed a commit to dipinhora/ponyc that referenced this pull request Jun 5, 2018
* Allow user defined help string at CommandSpec.add_help()

* Rename hinfo to descr',and leave it empty
dipinhora pushed a commit to dipinhora/ponyc that referenced this pull request Jun 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog - added Automatically add "Added" CHANGELOG entry on merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants