Safe Haskell | Safe-Infered |
---|
This is sample code using System.Console.MultiArg. This could
be a command-line parser for the version of the Unix command tail
that is included with GNU coreutils version 8.5. main simply gets
the command line arguments, parses them, and prints out what was
parsed. To test it out, simply compile an executable that looks
like this and then feed it different options:
import System.Console.MultiArg.SampleParser main = sampleMain Intersperse
or:
import System.Console.MultiArg.SampleParser main = sampleMain StopOptions
The code in the module is the sample code; the sample code is not in the Haddock documentation! If you're reading this in Haddock, you will want to also take a look at the actual source code.
Documentation
data Intersperse Source
What to do after encountering the first non-option, non-option-argument word on the command line? In either case, no more options are parsed after a stopper.
Intersperse | Additional options are allowed on the command line after
encountering the first positional argument. For example, if |
StopOptions | No additional options will be parsed after encountering the
first positional argument. For example, if |
sampleMain :: Intersperse -> IO ()Source