summaryrefslogtreecommitdiff
path: root/CmdLine
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-07-09 01:02:27 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-07-09 01:02:27 -0400
commit32274462439c44972f5cec1054b623ad4396909f (patch)
tree632142c0be37b9647d863341eb4bd2f2c93bf705 /CmdLine
parent8d691787503262e7c5c768cd7eeb24e1ecf873f4 (diff)
finalOpt is the same as optional
Diffstat (limited to 'CmdLine')
-rw-r--r--CmdLine/GitAnnex/Options.hs8
1 files changed, 1 insertions, 7 deletions
diff --git a/CmdLine/GitAnnex/Options.hs b/CmdLine/GitAnnex/Options.hs
index 1472a4d2b..160c01a3a 100644
--- a/CmdLine/GitAnnex/Options.hs
+++ b/CmdLine/GitAnnex/Options.hs
@@ -84,7 +84,7 @@ parseUnusedKeysOption = switch
)
parseSpecificKeyOption :: Parser (Maybe Key)
-parseSpecificKeyOption = finalOpt $ option (str >>= parseKey)
+parseSpecificKeyOption = optional $ option (str >>= parseKey)
( long "key"
<> help "operate on specified key"
<> metavar paramKey
@@ -201,9 +201,3 @@ parseAutoOption = switch
{- Parser that accepts all non-option params. -}
cmdParams :: CmdParamsDesc -> Parser CmdParams
cmdParams paramdesc = many (argument str (metavar paramdesc))
-
-{- Makes an option parser that is normally required be optional;
- - - its switch can be given zero or more times, and the last one
- - - given will be used. -}
-finalOpt :: Parser a -> Parser (Maybe a)
-finalOpt = lastMaybe <$$> many