summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-11-05 18:24:15 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-11-05 18:24:15 -0400
commitd8a1741254643a7c5b324cabe8c00e36b58434d8 (patch)
tree6390bcea81c5b8271e92a07de4b8c8e20de9f4bf /Command
parenta2c9cbbdc4047b799321ec388a94d4f96951a6f2 (diff)
-J for add/addurl/import
Diffstat (limited to 'Command')
-rw-r--r--Command/Add.hs4
-rw-r--r--Command/AddUrl.hs13
-rw-r--r--Command/Import.hs4
3 files changed, 11 insertions, 10 deletions
diff --git a/Command/Add.hs b/Command/Add.hs
index 11682207e..94a19fba5 100644
--- a/Command/Add.hs
+++ b/Command/Add.hs
@@ -35,7 +35,7 @@ import Utility.Tmp
import Control.Exception (IOException)
cmd :: Command
-cmd = notBareRepo $ withGlobalOptions fileMatchingOptions $
+cmd = notBareRepo $ withGlobalOptions (jobsOption : fileMatchingOptions) $
command "add" SectionCommon "add files to annex"
paramPaths (seek <$$> optParser)
@@ -56,7 +56,7 @@ optParser desc = AddOptions
-
- In direct mode, it acts on any files that have changed. -}
seek :: AddOptions -> CommandSeek
-seek o = do
+seek o = allowConcurrentOutput $ do
matcher <- largeFilesMatcher
let go a = flip a (addThese o) $ \file -> ifM (checkFileMatcher matcher file <||> Annex.getState Annex.force)
( start file
diff --git a/Command/AddUrl.hs b/Command/AddUrl.hs
index 4b34051e9..6ed4fb2e2 100644
--- a/Command/AddUrl.hs
+++ b/Command/AddUrl.hs
@@ -38,7 +38,7 @@ import qualified Utility.Quvi as Quvi
#endif
cmd :: Command
-cmd = notBareRepo $
+cmd = notBareRepo $ withGlobalOptions [jobsOption] $
command "addurl" SectionCommon "add urls to annex"
(paramRepeating paramUrl) (seek <$$> optParser)
@@ -87,11 +87,12 @@ parseRawOption = switch
)
seek :: AddUrlOptions -> CommandSeek
-seek o = forM_ (addUrls o) $ \u -> do
- r <- Remote.claimingUrl u
- if Remote.uuid r == webUUID || rawOption o
- then void $ commandAction $ startWeb o u
- else checkUrl r o u
+seek o = allowConcurrentOutput $
+ forM_ (addUrls o) $ \u -> do
+ r <- Remote.claimingUrl u
+ if Remote.uuid r == webUUID || rawOption o
+ then void $ commandAction $ startWeb o u
+ else checkUrl r o u
checkUrl :: Remote -> AddUrlOptions -> URLString -> Annex ()
checkUrl r o u = do
diff --git a/Command/Import.hs b/Command/Import.hs
index a96c08055..3ace2d2b0 100644
--- a/Command/Import.hs
+++ b/Command/Import.hs
@@ -21,7 +21,7 @@ import Annex.CheckIgnore
import Annex.NumCopies
cmd :: Command
-cmd = withGlobalOptions fileMatchingOptions $ notBareRepo $
+cmd = withGlobalOptions (jobsOption : fileMatchingOptions) $ notBareRepo $
command "import" SectionCommon
"move and add files from outside git working copy"
paramPaths (seek <$$> optParser)
@@ -59,7 +59,7 @@ duplicateModeParser =
)
seek :: ImportOptions -> CommandSeek
-seek o = do
+seek o = allowConcurrentOutput $ do
repopath <- liftIO . absPath =<< fromRepo Git.repoPath
inrepops <- liftIO $ filter (dirContains repopath) <$> mapM absPath (importFiles o)
unless (null inrepops) $ do