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
|
@ -28,21 +28,22 @@ command = [repoCommand "initremote"
|
|||
"sets up a special (non-git) remote"]
|
||||
|
||||
seek :: [CommandSeek]
|
||||
seek = [withString start]
|
||||
seek = [withWords start]
|
||||
|
||||
start :: CommandStartString
|
||||
start params = notBareRepo $ do
|
||||
start :: CommandStartWords
|
||||
start ws = notBareRepo $ do
|
||||
when (null ws) $ error "Specify a name for the remote"
|
||||
|
||||
(u, c) <- findByName name
|
||||
let fullconfig = M.union config c
|
||||
t <- findType fullconfig
|
||||
|
||||
liftIO $ putStrLn $ show fullconfig
|
||||
|
||||
showStart "initremote" name
|
||||
next $ perform t u $ M.union config c
|
||||
|
||||
where
|
||||
ws = words params
|
||||
name = head ws
|
||||
config = Remote.keyValToConfig $ tail ws
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue