better multiword parameter handling

This way, individual words as entered on the command line are available
to commands.
This commit is contained in:
Joey Hess 2011-05-16 12:25:54 -04:00
parent 8fa17eaba0
commit ceff04ff3e
7 changed files with 30 additions and 22 deletions

View file

@ -27,15 +27,17 @@ command = [repoCommand "init" paramDesc seek
"initialize git-annex with repository description"]
seek :: [CommandSeek]
seek = [withString start]
seek = [withWords start]
{- Stores description for the repository etc. -}
start :: CommandStartString
start description = do
start :: CommandStartWords
start ws = do
when (null description) $
error "please specify a description of this repository\n"
showStart "init" description
next $ perform description
where
description = unwords ws
perform :: String -> CommandPerform
perform description = do