diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-02-08 15:04:58 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-02-08 15:04:58 -0400 |
commit | d2770cfaa62a25fee2944af086530f58939ddfb5 (patch) | |
tree | bf597707871a598b31c3ab62a210c2b6450ab01d /CmdLine | |
parent | 072b440e4dddd32c590726ec9610bb6796314a71 (diff) |
better option handling
At least it avoids the big truth table lookup
Diffstat (limited to 'CmdLine')
-rw-r--r-- | CmdLine/Option.hs | 4 |
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 |