commandlineparser / commandlineparser/commandline

HelpVerbOption does not show detailed help for a specific verb

オープン
#86 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement
主要言語
C#
スター
4.8k
フォーク
478
PR マージ指標
30日以内にマージされた PR はありません

説明

**Issue by [Kohlroulade](https://github.com/Kohlroulade)**
_Monday Sep 12, 2016 at 07:47 GMT_
_Originally opened as https://github.com/gsscoder/commandline/issues/347_

----

As mentioned on [this thread at StackOverflow](http://stackoverflow.com/questions/39079282/helpverboption-does-not-work-command-line-parser-c-sharp/39347522#39347522) 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](http://stackoverflow.com/a/39347522/2528063) 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`.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。