From e7e61fb6cbe5455ded9bb550a64121223c099fc2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 8 Jul 2015 15:08:02 -0400 Subject: convert all commands to work with optparse-applicative Still no options though. --- Command.hs | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'Command.hs') diff --git a/Command.hs b/Command.hs index 4fc665ba2..c1d788c79 100644 --- a/Command.hs +++ b/Command.hs @@ -7,7 +7,6 @@ module Command ( command, - commandParser, noRepo, noCommit, noMessages, @@ -33,20 +32,11 @@ import CmdLine.Action as ReExported import CmdLine.Option as ReExported import CmdLine.GitAnnex.Options as ReExported -import qualified Options.Applicative as O - {- Generates a normal Command -} -command :: String -> String -> CommandSection -> String -> (Command -> CommandParser) -> Command -command name paramdesc section desc parser = c - where - c = Command [] Nothing commonChecks False False name paramdesc section desc (parser c) - -{- Simple CommandParser generator, for when the CommandSeek wants all - - non-option parameters. -} -commandParser :: (CmdParams -> CommandSeek) -> Command -> CommandParser -commandParser mkseek c = mkseek <$> O.many cmdparams - where - cmdparams = O.argument O.str (O.metavar (cmdparamdesc c)) +command :: String -> CommandSection -> String -> String -> (String -> CommandParser) -> Command +command name section desc paramdesc mkparser = + Command [] Nothing commonChecks False False name paramdesc + section desc (mkparser paramdesc) {- Indicates that a command doesn't need to commit any changes to - the git-annex branch. -} -- cgit v1.2.3