better multiword parameter handling
This way, individual words as entered on the command line are available to commands.
This commit is contained in:
parent
8fa17eaba0
commit
ceff04ff3e
7 changed files with 30 additions and 22 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue