update
This commit is contained in:
parent
bbbe9858fe
commit
e7ffa5b594
1 changed files with 6 additions and 5 deletions
11
Commands.hs
11
Commands.hs
|
@ -21,8 +21,8 @@ import Types
|
||||||
import Core
|
import Core
|
||||||
import qualified Remotes
|
import qualified Remotes
|
||||||
|
|
||||||
{- Parses command line and returns a list of actons to be run in the Annex
|
{- Parses command line and returns a list of flags and a list of
|
||||||
- monad. -}
|
- actions to be run in the Annex monad. -}
|
||||||
parseCmd :: [String] -> IO ([Flag], [Annex ()])
|
parseCmd :: [String] -> IO ([Flag], [Annex ()])
|
||||||
parseCmd argv = do
|
parseCmd argv = do
|
||||||
(flags, nonopts) <- getopt
|
(flags, nonopts) <- getopt
|
||||||
|
@ -40,15 +40,16 @@ parseCmd argv = do
|
||||||
(_, _, errs) -> ioError (userError (concat errs ++ usageInfo header options))
|
(_, _, errs) -> ioError (userError (concat errs ++ usageInfo header options))
|
||||||
lookupCmd cmd = filter (\(c, a) -> c == cmd) cmds
|
lookupCmd cmd = filter (\(c, a) -> c == cmd) cmds
|
||||||
cmds = [ ("add", addCmd)
|
cmds = [ ("add", addCmd)
|
||||||
|
, ("get", getCmd)
|
||||||
|
, ("drop", dropCmd)
|
||||||
|
, ("want", wantCmd)
|
||||||
, ("push", pushCmd)
|
, ("push", pushCmd)
|
||||||
, ("pull", pullCmd)
|
, ("pull", pullCmd)
|
||||||
, ("want", wantCmd)
|
|
||||||
, ("drop", dropCmd)
|
|
||||||
, ("unannex", unannexCmd)
|
, ("unannex", unannexCmd)
|
||||||
]
|
]
|
||||||
header = "Usage: git-annex [" ++
|
header = "Usage: git-annex [" ++
|
||||||
(join "|" $ map fst cmds) ++ "] file ..."
|
(join "|" $ map fst cmds) ++ "] file ..."
|
||||||
options = [ Option ['f'] ["force"] (NoArg Force) "" ]
|
options = [ Option ['f'] ["force"] (NoArg Force) "allow actions that may loose annexed data" ]
|
||||||
|
|
||||||
{- Default mode is to annex a file if it is not already, and otherwise
|
{- Default mode is to annex a file if it is not already, and otherwise
|
||||||
- get its content. -}
|
- get its content. -}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue