From d8a1741254643a7c5b324cabe8c00e36b58434d8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 5 Nov 2015 18:24:15 -0400 Subject: -J for add/addurl/import --- Command/Add.hs | 4 ++-- Command/AddUrl.hs | 13 +++++++------ Command/Import.hs | 4 ++-- 3 files changed, 11 insertions(+), 10 deletions(-) (limited to 'Command') 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 -- cgit v1.2.3