support cmdnorepo actions, also using getopt-applicative there

This commit is contained in:
Joey Hess 2015-07-08 15:39:05 -04:00
parent 6e5c1f8db3
commit 92d8f80bff
10 changed files with 54 additions and 68 deletions

View file

@ -11,7 +11,6 @@ import Common.Annex
import Types.Command
import System.Console.GetOpt
import qualified Options.Applicative as O
usageMessage :: String -> String
usageMessage s = "Usage: " ++ s
@ -56,13 +55,6 @@ commandUsage cmd = unlines
, "[option ...]"
]
{- Simple CommandParser generator, for when the CommandSeek wants all
- non-option parameters. -}
withParams :: (CmdParams -> CommandSeek) -> String -> CommandParser
withParams mkseek paramdesc = mkseek <$> O.many cmdparams
where
cmdparams = O.argument O.str (O.metavar paramdesc)
{- Descriptions of params used in usage messages. -}
paramPaths :: String
paramPaths = paramRepeating paramPath -- most often used