Open robrich opened 6 years ago
I found a temporary workaround for this:
Sub Main
...
oParser.SetupHelp("?", "help").Callback(GetHelp(oParser.Options))
End Main
Public Function GetHelp(Options As List(Of ICommandLineOption)) As Action(Of String)
Dim oBuilder As StringBuilder
Dim oOption As ICommandLineOption
Dim sUsage As String
Return Sub(Usage)
oBuilder = New StringBuilder
oOption = Options.First
oBuilder.AppendLine($"Backup [(/{oOption.ShortName} | /{oOption.LongName}):JobName]")
oBuilder.AppendLine()
oBuilder.AppendLine("This argument is optional. If it isn't provided, the configuration window is displayed.")
sUsage = oBuilder.ToString
MessageBox.Show(sUsage, "Usage", MessageBoxButtons.OK, MessageBoxIcon.None)
End Sub
End Function
Help doesn't make it obvious that the user needs to include dashes when passing options.
I was working with a novice user with one of my command-line apps. He passed in nothing, it correctly displayed the help:
(not the real options)
So he called
myapp.exe b foo l bar
and it happily did nothing.Showing help like this would make it more obvious:
Would you accept a PR to change the help to this format?