summaryrefslogtreecommitdiff
path: root/Command.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-07-08 15:08:02 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-07-08 15:08:02 -0400
commite7e61fb6cbe5455ded9bb550a64121223c099fc2 (patch)
tree003a99697256ea516ad40f9fbdb854996b58c0cd /Command.hs
parent8879c96d157f06bbd2372064251676b7927ce38e (diff)
convert all commands to work with optparse-applicative
Still no options though.
Diffstat (limited to 'Command.hs')
-rw-r--r--Command.hs18
1 files changed, 4 insertions, 14 deletions
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. -}