docopt.hs
docopt.hs copied to clipboard
A command-line interface description language and parser that will make you smile
Given this cli tool: ```txt Usage: perspec ... perspec rename ``` When I run `perspec rename` it treats `rename` as a ``. The subcommand should be prioritized.
Consider [this example](http://try.docopt.org/?doc=Naval+Fate.%0D%0A%0D%0AUsage%3A%0D%0A++naval_fate.py+ship+new+%3Cname%3E...%0D%0A++naval_fate.py+ship+%3Cname%3E+move+%3Cx%3E+%3Cy%3E+[--speed%3D%3Ckn%3E]%0D%0A++naval_fate.py+ship+shoot+%3Cx%3E+%3Cy%3E%0D%0A++naval_fate.py+mine+(set|remove)+%3Cx%3E+%3Cy%3E+[--moored|--drifting]%0D%0A++naval_fate.py+-h+|+--help%0D%0A++naval_fate.py+--version%0D%0A%0D%0AOptions%3A%0D%0A++-h+--help+++++Show+this+screen.%0D%0A++--version+++++Show+version.%0D%0A++--speed%3D%3Ckn%3E++Speed+in+knots+[default%3A+10].%0D%0A++--moored++++++Moored+(anchored)+mine.%0D%0A++--drifting++++Drifting+mine.%0D%0A%0D%0A&argv=ship). Per the reference implementation, an incorrect sequence of arguments should output the brief usage description. I adapted the example from the readme: ``` {-# LANGUAGE QuasiQuotes #-}...
Fixes https://github.com/docopt/docopt.hs/issues/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....
### Discussed in https://github.com/docopt/docopt.hs/discussions/36 Originally posted by **FullstackGJJ** June 26, 2021 I'm looking through the repo that this port is based off of and it seems like it has a...
Thanks for docopt. On https://github.com/simonmichael/hledger/issues/682 @jeevcat reports a failure that only happens on windows. Is docopt known to work on windows ? Could it be getting confused by line endings...
Hey, Does this Haskell version of Docopt allow passing options _after_ positional arguments, too? My first crack at it seemed not to. That's something like specifying the following: ``` Usage:...
As hinted in https://github.com/docopt/docopt.hs/issues/24#issuecomment-153082237 there is currently no way to get a list out of options. There is `getAllArgs`, but it only works for positional arguments.
This would be awesome! :)
While filing up #18, I found a small inconsistency in the way ambiguities are resolved. According to docopt.org: > Note, writing --input ARG (opposed to --input=ARG) is ambiguous, meaning it...
Fixes https://github.com/docopt/docopt.hs/issues/32. (moved from https://github.com/docopt/docopt.hs/pull/50 -- it looks like it'll need a few more edits now since 2.5 years ago :) ) This makes 3 main changes to this library's...