From ceff04ff3e7fff4b0ea6e8ad4334cca80d291880 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 16 May 2011 12:25:54 -0400 Subject: better multiword parameter handling This way, individual words as entered on the command line are available to commands. --- Command/InitRemote.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'Command/InitRemote.hs') diff --git a/Command/InitRemote.hs b/Command/InitRemote.hs index 261ccdc8b..ae22e3564 100644 --- a/Command/InitRemote.hs +++ b/Command/InitRemote.hs @@ -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 -- cgit v1.2.3