Skip to content

HelpVerbOption does not show detailed help for a specific verb #86

@ericnewton76

Description

@ericnewton76
Member

Issue by Kohlroulade
Monday Sep 12, 2016 at 07:47 GMT
Originally opened as gsscoder/commandline#347


As mentioned on this thread at StackOverflow the HelpVerbOption only shows the general help for the available verb, but not the detailed help for a particular help-verb.

I suppose this is because of code in method TryParseHelpVerb in Parser.cs. Assume we entered MyApp help theVerb on bash. As args.FirstOrDefault will allways evaluate to help instead of the actual verb we want the help for and the optionMap on the next line won´t contain an option for help the method will allways return false as the calling method DoParseArgumentsVerbs also.

To come around have a look at my suggested solution within the thread. Maybe we should add some checks in order to don´t get an NRE or similar, however I hope you get what I ment.

EDIT: To make the solution also work for the --help option in combination with a verb we may also trim the args[0] within if (string.Compare(args[0], helpInfo.Right.LongName, GetStringComparison(_settings)) == 0) also in Parser.cs.

Activity

ericnewton76

ericnewton76 commented on Nov 4, 2017

@ericnewton76
MemberAuthor

Comment by nemec
Saturday Nov 05, 2016 at 07:37 GMT


It looks like the same (or similar) issue is happening in the master (2.x) branch, though the code has changed a lot so your solution above doesn't apply anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @ericnewton76

        Issue actions

          HelpVerbOption does not show detailed help for a specific verb · Issue #86 · commandlineparser/commandline