forked from docopt/docopt.hs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make usage-/help-string behavior consistent with original
docopt
Fixes docopt#32. This makes 3 main changes to this library's behavior: 1) `pUsagePatterns` (and thus `pDocopt`) 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` and `exitWithUsaegMessage` 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 if `longOption "help"` is present, to be more consistent with the original `docopt` behavior. I'm not sure this is the correct place in the library to put it, but it creates the intended behavior.
- Loading branch information
Showing
7 changed files
with
31 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters