summaryrefslogtreecommitdiff
path: root/examples/Pipes.hs
diff options
context:
space:
mode:
authordefanor <defanor@uberspace.net>2017-12-24 07:12:59 +0300
committerdefanor <defanor@uberspace.net>2017-12-24 07:12:59 +0300
commit2581f4b9a61d8ca4c782269886c30b3cc433d85d (patch)
treeccdcb609ab9247706cbc012e2bf8abb47a3678af /examples/Pipes.hs
parent1d68da2eb258a1f426184989832208c75cac1f50 (diff)
Introduce 'Usage' structure.
Produce it with 'argHelper' first, then translate into a string -- so that it can be reused for other kinds of output, such as roff and texinfo.
Diffstat (limited to 'examples/Pipes.hs')
-rw-r--r--examples/Pipes.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/Pipes.hs b/examples/Pipes.hs
index 7b50f93..b1096e3 100644
--- a/examples/Pipes.hs
+++ b/examples/Pipes.hs
@@ -37,7 +37,8 @@ runMain :: forall m a i o. (MonadIO m, Coalpit a, Coalpit i, Coalpit o)
-> m ()
runMain e f = do
pn <- liftIO getProgName
- let u = Prelude.concat ["Usage: ", pn, " ", usage defOpt (Proxy :: Proxy a)]
+ let u = Prelude.concat [ "Usage: ", pn, " "
+ , usageString defOpt (Proxy :: Proxy a)]
args <- liftIO getArgs
a <- either (liftIO . die . (++ u)) pure $ fromArgs defOpt args
runEffect $