Closed jpdoyle closed 7 months ago
Oh we moved the default branch from master
to main
and if you then delete the old branch it closes PR's that were opened against that branch. I have no opinion (yet) on this PR; I'd like to keep it open but that is impossible. I'll make a note to look at this later.
Fixes https://github.com/docopt/docopt.hs/issues/32.
This makes 3 main changes to this library's behavior:
1)
pUsagePatterns
(and thuspDocopt
) parses out the "Usage:" section of the helpstring as a string and returns that. The way I'm parsing it feels really hacky but I wasn't sure a better way to achieve it. 2)exitWithUsage
andexitWithUsaegMessage
now print that "short usage string" rather than the whole helpstring.exitWithHelpstring
has been added, which prints the whole helpstring. 3)parseArgsOrExit
automatically exits printing the helpstring iflongOption "help"
is present, to be more consistent with the originaldocopt
behavior. I'm not sure this is the correct place in the library to put it, but it creates the intended behavior.