summaryrefslogtreecommitdiff
path: root/CmdLine
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-02-08 15:04:58 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-02-08 15:04:58 -0400
commitd2770cfaa62a25fee2944af086530f58939ddfb5 (patch)
treebf597707871a598b31c3ab62a210c2b6450ab01d /CmdLine
parent072b440e4dddd32c590726ec9610bb6796314a71 (diff)
better option handling
At least it avoids the big truth table lookup
Diffstat (limited to 'CmdLine')
-rw-r--r--CmdLine/Option.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/CmdLine/Option.hs b/CmdLine/Option.hs
index 1b82dc83e..2d4e67fa3 100644
--- a/CmdLine/Option.hs
+++ b/CmdLine/Option.hs
@@ -10,6 +10,7 @@ module CmdLine.Option (
flagOption,
fieldOption,
optionName,
+ optionParam,
ArgDescr(..),
OptDescr(..),
) where
@@ -68,3 +69,6 @@ fieldOption short opt paramdesc description =
{- The flag or field name used for an option. -}
optionName :: Option -> String
optionName (Option _ o _ _) = Prelude.head o
+
+optionParam :: Option -> String
+optionParam o = "--" ++ optionName o