summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-07-19 14:07:23 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-07-19 14:07:23 -0400
commit00153eed48a2328969cc08688ef674a4c19c2014 (patch)
treef2ee8ac90225d1d2329f45b43061b53b7757d815 /Command
parentec9e9343d9fa99b0786ee93ff142484e2402d3c8 (diff)
unify elipsis handling
And add a simple dots-based progress display, currently only used in v2 upgrade.
Diffstat (limited to 'Command')
-rw-r--r--Command/AddUrl.hs2
-rw-r--r--Command/DropUnused.hs2
-rw-r--r--Command/Get.hs2
-rw-r--r--Command/Map.hs8
-rw-r--r--Command/Move.hs14
-rw-r--r--Command/Unlock.hs2
-rw-r--r--Command/Unused.hs4
-rw-r--r--Command/Whereis.hs2
8 files changed, 18 insertions, 18 deletions
diff --git a/Command/AddUrl.hs b/Command/AddUrl.hs
index e80fe9621..1b12362e9 100644
--- a/Command/AddUrl.hs
+++ b/Command/AddUrl.hs
@@ -43,7 +43,7 @@ start s = do
perform :: String -> FilePath -> CommandPerform
perform url file = do
g <- Annex.gitRepo
- showNote $ "downloading " ++ url
+ showAction $ "downloading " ++ url ++ " "
let dummykey = stubKey { keyName = url, keyBackendName = "URL" }
let tmp = gitAnnexTmpLocation g dummykey
liftIO $ createDirectoryIfMissing True (parentDir tmp)
diff --git a/Command/DropUnused.hs b/Command/DropUnused.hs
index a01e08ab5..41bcd6aa7 100644
--- a/Command/DropUnused.hs
+++ b/Command/DropUnused.hs
@@ -61,7 +61,7 @@ perform key = maybe droplocal dropremote =<< Annex.getState Annex.fromremote
where
dropremote name = do
r <- Remote.byName name
- showNote $ "from " ++ Remote.name r ++ "..."
+ showAction $ "from " ++ Remote.name r
next $ Command.Move.fromCleanup r True key
droplocal = Command.Drop.perform key (Just 0) -- force drop
diff --git a/Command/Get.hs b/Command/Get.hs
index cc780cb6a..e0436a868 100644
--- a/Command/Get.hs
+++ b/Command/Get.hs
@@ -75,7 +75,7 @@ getKeyFile key file = do
Left _ -> return False
else return True
docopy r continue = do
- showNote $ "from " ++ Remote.name r ++ "..."
+ showAction $ "from " ++ Remote.name r
copied <- Remote.retrieveKeyFile r key file
if copied
then return True
diff --git a/Command/Map.hs b/Command/Map.hs
index 557ae2787..07f127f14 100644
--- a/Command/Map.hs
+++ b/Command/Map.hs
@@ -44,7 +44,7 @@ start = do
liftIO $ writeFile file (drawMap rs umap trusted)
showLongNote $ "running: dot -Tx11 " ++ file
- showProgress
+ showOutput
r <- liftIO $ boolSystem "dot" [Param "-Tx11", File file]
next $ next $ return r
where
@@ -176,7 +176,7 @@ scan r = do
showEndOk
return r'
Nothing -> do
- showProgress
+ showOutput
showEndFail
return r
@@ -224,5 +224,5 @@ tryScan r
ok -> return ok
sshnote = do
- showNote "sshing..."
- showProgress
+ showAction "sshing"
+ showOutput
diff --git a/Command/Move.hs b/Command/Move.hs
index a98276e7e..a081a863f 100644
--- a/Command/Move.hs
+++ b/Command/Move.hs
@@ -44,9 +44,9 @@ start move file = do
fromStart src move file
(_ , _) -> error "only one of --from or --to can be specified"
-showAction :: Bool -> FilePath -> Annex ()
-showAction True file = showStart "move" file
-showAction False file = showStart "copy" file
+showMoveAction :: Bool -> FilePath -> Annex ()
+showMoveAction True file = showStart "move" file
+showMoveAction False file = showStart "copy" file
{- Used to log a change in a remote's having a key. The change is logged
- in the local repo, not on the remote. The process of transferring the
@@ -77,7 +77,7 @@ toStart dest move file = isAnnexed file $ \(key, _) -> do
if not ishere || u == Remote.uuid dest
then stop -- not here, so nothing to do
else do
- showAction move file
+ showMoveAction move file
next $ toPerform dest move key
toPerform :: Remote.Remote Annex -> Bool -> Key -> CommandPerform
toPerform dest move key = do
@@ -97,7 +97,7 @@ toPerform dest move key = do
showNote $ show err
stop
Right False -> do
- showNote $ "to " ++ Remote.name dest ++ "..."
+ showAction $ "to " ++ Remote.name dest
ok <- Remote.storeKey dest key
if ok
then next $ toCleanup dest move key
@@ -127,7 +127,7 @@ fromStart src move file = isAnnexed file $ \(key, _) -> do
if u == Remote.uuid src || not (any (== src) remotes)
then stop
else do
- showAction move file
+ showMoveAction move file
next $ fromPerform src move key
fromPerform :: Remote.Remote Annex -> Bool -> Key -> CommandPerform
fromPerform src move key = do
@@ -135,7 +135,7 @@ fromPerform src move key = do
if ishere
then next $ fromCleanup src move key
else do
- showNote $ "from " ++ Remote.name src ++ "..."
+ showAction $ "from " ++ Remote.name src
ok <- getViaTmp key $ Remote.retrieveKeyFile src key
if ok
then next $ fromCleanup src move key
diff --git a/Command/Unlock.hs b/Command/Unlock.hs
index d189545f5..280eff9de 100644
--- a/Command/Unlock.hs
+++ b/Command/Unlock.hs
@@ -45,7 +45,7 @@ perform dest key = do
let src = gitAnnexLocation g key
let tmpdest = gitAnnexTmpLocation g key
liftIO $ createDirectoryIfMissing True (parentDir tmpdest)
- showNote "copying..."
+ showAction "copying"
ok <- liftIO $ copyFile src tmpdest
if ok
then do
diff --git a/Command/Unused.hs b/Command/Unused.hs
index 870c993f1..e7065b3c3 100644
--- a/Command/Unused.hs
+++ b/Command/Unused.hs
@@ -68,7 +68,7 @@ checkRemoteUnused name = do
checkRemoteUnused' :: Remote.Remote Annex -> Annex ()
checkRemoteUnused' r = do
- showNote "checking for unused data..."
+ showAction "checking for unused data"
referenced <- getKeysReferenced
remotehas <- filterM isthere =<< loggedKeys
let remoteunused = remotehas `exclude` referenced
@@ -152,7 +152,7 @@ unusedKeys = do
bad <- staleKeys gitAnnexBadDir
return ([], bad, tmp)
else do
- showNote "checking for unused data..."
+ showAction "checking for unused data"
present <- getKeysPresent
referenced <- getKeysReferenced
let unused = present `exclude` referenced
diff --git a/Command/Whereis.hs b/Command/Whereis.hs
index 05748e8d6..314fef782 100644
--- a/Command/Whereis.hs
+++ b/Command/Whereis.hs
@@ -35,7 +35,7 @@ perform key = do
else do
pp <- prettyPrintUUIDs uuids
showLongNote pp
- showProgress
+ showOutput
next $ return True
where
copiesplural 1 = "copy"