str
and related builders to be polymorphic over
IsString
. This allows Text
and Bytestring
to be used
naturally with strOption
and strArgument
and friends.Note: This change may require additional type signatures in cases where the reader was necessary for type inference.
Options.Applicative
instead of re-exporting other modules.Note: Minor changes to exports were made in conjunction
to this change. ParserHelp
no longer requires an
an extra import, and some internally used functions
from Options.Applicative.Common
are no longer
exported from the main module.
Use "--zsh-completion-script" and "fish-completion-script" to generate scripts for these shells.
Fix bash completions with quoted sections, tilde expansions and completions after "--".
Add suggestions to error message when a user mistypes a command or option.
Add style
builder, for styling option descriptions.
Improve error message for options when a required argument is not supplied.
Fix #242 regarding flags with long options, where a flag given a long option could be interpreted incorrectly.
Fix noIntersperse
to be more like its namesakes in other
libraries. When on, options will be accepted until an argument
is passed, after which all options will be treated as positional
arguments.
Add forwardOptions
builder, which will allow unknown options
and flags to be passed to an argument builder.
This is useful to mixed parsing environments, or wrappers to
other commands.
Add Semigroup
instances for Completer
and Chunk
.
Forwards compatibility with MonadFail
proposal.
Doc
Updated dependency bounds.
Doc
Updated dependency bounds.
Add required test files to cabal package.
Doc
Implement command groups, which allow subcommands to have their own usage description.
Implement showHelpOnEmpty, which is similar to showHelpOnError, but only fires when a command or subcommand is begun, and suppresses the "Missing:" error text.
Fix ghc 8.0 warnings
Fix ghc 7.10 warnings
Bump dependency bounds
Add maybeReader function for convenient ReadM creation
Move eitherReader to Readers section (for better discoverability)
Fix hsubparser metavar override
Remove ComplError, which was dead code.
Reimplement Missing error generation, which overly complicated evalParser.
Export Semigroup instances for types which are also Monoids. Removes
mempty synonym (<>)
export, as it clashes with Semigroup exports.
One may need to import Data.Monoid or Data.Semigroup when upgrading.
Use a Cabal test suite for tests, simplify test dependencies.
Updated dependency bounds.
Improve subparser contexts to improve usage error texts
Doc
Fixed bugs
Add "missing" error condition descriptions when required flags and arguments are not provided.
Allow multiple short flags to be concatenated together behind a single hyphen, e.g. "-xcf".
Updated dependency bounds on process
and ansi-wl-pprint
.
Add Show
and Eq
instances to some types for easier debugging.
Add defaultPrefs, a default preferences value
Docs.
Added Alternative instances for Chunk
and ReadM
.
The ReadM
monad is now a ReaderT
for the argument being parsed. User
defined readers do not need to handle their argument explicitly, but can
always access it using readerAsk
.
Argument builders now take a ReadM
parameter, just like options.
Fixed bugs
ReadM
Parser execution and help text generation are now more modular, and allow for greater customisation.
More consistent API for option
and argument
builders: now option
takes
a reader as argument, and nullOption
is deprecated in favour of option
.
The reader
modifier is gone. Quick migration guide:
option
(without a reader
modifier) => option auto
nullOption
(without a reader
modifier) => option disabled
option
/nullOption
(with a reader r
modifier) => option r
.Added convenience builder strArgument
, equivalent to argument str
.
Removed functions deprecated from at least version 0.8.0.
Switched test infrastructure to tasty
.
Fixed bugs
Documentation tweaks.
Added low-level function to handle parse results (pull request #94).
ParserResult
now has a Show
instance (see issue #95).
Fixed bugs
abortOption
is now visible by default.Help page formatting. Added columns
preference modifier,
which can be used to specify the number of columns in the output
terminal.
Deprecated arguments
and arguments1
builders. Using many
and some
on a
parser built using argument
now returns a multiple argument parsers that
behaves correctly with respect to --
.
Fixed bugs
Added builders for options that always fail. This makes it
easier to create options that just print an error message or
display some brief information and then exit (like --version
).
Added execParserMaybe
and customExecParserMaybe
functions
(pull request #49).
Fixed bugs
Arguments are now always parsed in order.
Fixed bugs
There is a new parser preference noBacktrack
, that controls whether how a
failure in a subparser is propagated. By default, an unknown option in a
subparser causes the option to be looked up in parent parsers. When
noBacktrack
is used, this behavior is disabled. This is useful to implement
subcommands that have no relations with their parent commands.
Fixed bugs
Arrow
interfaceFewer GHC extensions required.
Improved error handling: unrecognized options now result in an error message.
By default, the full help text is not displayed on parse errors anymore.
This behavior can be controlled with the prefShowHelpOnError
field of
ParserPrefs
.
The (&)
operator is now deprecated. Modifiers can still be combined using
(<>)
or mappend
.
Fixed bugs
Brief help text for nested commands now shows the full command line.
Fixed inefficiency in the arguments
parsers for long argument lists.
Added automatic bash completion.
Added disambiguate
modifier for prefs
, which enabled automatic
disambiguation of option abbreviations. With disambiguation on, a command line
like:
foo --out
will match an option called --output
, as long as its the only one starting
with the string out
.
Added briefDesc
modifier.
Fixed bugs
Fixed bug where both branches of an alternative could be matched.
Improved brief help text for alternatives.
Added new showDefault
and showDefaultWith
modifiers, which will result in
the default value (if present) to be displayed in the help text.
Fixed bugs
Option modifiers are now instances of Monoid
instead of Category
.
Dropped dependencies on data-default and data-lens.
Fixed bugs
Parser is now an instance of Alternative. This makes it possible to build
certain complex parsers that were not definable before. See
tests/Examples/Alternatives.hs
for a simple example.
Removed multi
modifier. You can now use the many
or some
methods from
Alternative
, instead, to create parsers for options that can appear more than
once.
Added new flag'
builder that returns a flag without a default value.
Although flags without default values were not useful before, with the addition
of Alternative
combinators, they do have valid use cases.
Added new internal
modifier for options. An internal option is completely
invisible in the help text.
Added a new customExecParser
function, which takes an additional
ParserPrefs
parameter. At the moment, ParserPrefs
can only be used to
control how many-valued option metavars are displayed in the help text. Setting
its multiSuffix
field to e.g. ...
will result in an arguments
parser
description like [METAVAR]...
.
Fixed bugs
New arrow interface
Fixed bugs
Improved error reporting internals
Removed template-haskell dependency
Fixed bugs: