aboutsummaryrefslogtreecommitdiff
path: root/Command/FromKey.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-04-07 00:58:51 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-04-07 00:58:51 -0400
commitd8394ede7b16d9aafcc19885f31d7935250a9bb6 (patch)
tree7615d95b51844b54cd37690206b045197f86c055 /Command/FromKey.hs
parent466a2c31be0f662c3c93dd54867d2a969e01714e (diff)
fromkey, registerurl: When reading from stdin, allow the filename and url, respectively, to contain whitespace.
Diffstat (limited to 'Command/FromKey.hs')
-rw-r--r--Command/FromKey.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Command/FromKey.hs b/Command/FromKey.hs
index 10484b840..ebc0e6f6e 100644
--- a/Command/FromKey.hs
+++ b/Command/FromKey.hs
@@ -41,10 +41,10 @@ start _ [] = do
start _ _ = error "specify a key and a dest file"
massAdd :: CommandPerform
-massAdd = go True =<< map words . lines <$> liftIO getContents
+massAdd = go True =<< map (separate (== ' ')) . lines <$> liftIO getContents
where
go status [] = next $ return status
- go status ([keyname,f]:rest) = do
+ go status ((keyname,f):rest) | not (null keyname) && not (null f) = do
let key = fromMaybe (error $ "bad key " ++ keyname) $ file2key keyname
ok <- perform' key f
let !status' = status && ok