summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-09-15 14:33:37 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-09-15 14:33:37 -0400
commit9fe3c6d21134638a29c6ad4ced6a11ed9b0242ed (patch)
tree36969080623ed8f085b69cc0ae9673b724f8d87c
parent984c9fc0523bcd3bfcd7de83f4f7974daa6872bc (diff)
clean up params in usage display
-rw-r--r--Command.hs14
-rw-r--r--Command/Add.hs2
-rw-r--r--Command/Copy.hs2
-rw-r--r--Command/Drop.hs2
-rw-r--r--Command/Find.hs3
-rw-r--r--Command/Fix.hs2
-rw-r--r--Command/Fsck.hs3
-rw-r--r--Command/Get.hs2
-rw-r--r--Command/Lock.hs2
-rw-r--r--Command/Migrate.hs3
-rw-r--r--Command/Move.hs2
-rw-r--r--Command/PreCommit.hs2
-rw-r--r--Command/Unannex.hs2
-rw-r--r--Command/Uninit.hs2
-rw-r--r--Command/Unlock.hs4
-rw-r--r--Command/Whereis.hs2
16 files changed, 25 insertions, 24 deletions
diff --git a/Command.hs b/Command.hs
index 9d85fbe9d..c1069f0d9 100644
--- a/Command.hs
+++ b/Command.hs
@@ -212,12 +212,8 @@ notSymlink :: FilePath -> IO Bool
notSymlink f = liftIO $ not . isSymbolicLink <$> getSymbolicLinkStatus f
{- Descriptions of params used in usage messages. -}
-paramRepeating :: String -> String
-paramRepeating s = s ++ " ..."
-paramOptional :: String -> String
-paramOptional s = "[" ++ s ++ "]"
-paramPair :: String -> String -> String
-paramPair a b = a ++ " " ++ b
+paramPaths :: String
+paramPaths = paramOptional $ paramRepeating paramPath -- most often used
paramPath :: String
paramPath = "PATH"
paramKey :: String
@@ -240,6 +236,12 @@ paramKeyValue :: String
paramKeyValue = "K=V"
paramNothing :: String
paramNothing = ""
+paramRepeating :: String -> String
+paramRepeating s = s ++ " ..."
+paramOptional :: String -> String
+paramOptional s = "[" ++ s ++ "]"
+paramPair :: String -> String -> String
+paramPair a b = a ++ " " ++ b
{- The Key specified by the --key parameter. -}
cmdlineKey :: Annex Key
diff --git a/Command/Add.hs b/Command/Add.hs
index 579c4171b..f6dfd2da4 100644
--- a/Command/Add.hs
+++ b/Command/Add.hs
@@ -29,7 +29,7 @@ import Utility.SafeCommand
import Locations
command :: [Command]
-command = [repoCommand "add" paramPath seek "add files to annex"]
+command = [repoCommand "add" paramPaths seek "add files to annex"]
{- Add acts on both files not checked into git yet, and unlocked files. -}
seek :: [CommandSeek]
diff --git a/Command/Copy.hs b/Command/Copy.hs
index 46d49dd05..7d40f438d 100644
--- a/Command/Copy.hs
+++ b/Command/Copy.hs
@@ -11,7 +11,7 @@ import Command
import qualified Command.Move
command :: [Command]
-command = [repoCommand "copy" paramPath seek
+command = [repoCommand "copy" paramPaths seek
"copy content of files to/from another repository"]
-- A copy is just a move that does not delete the source file.
diff --git a/Command/Drop.hs b/Command/Drop.hs
index 32cb81e80..1325e3dcb 100644
--- a/Command/Drop.hs
+++ b/Command/Drop.hs
@@ -20,7 +20,7 @@ import Trust
import Config
command :: [Command]
-command = [repoCommand "drop" paramPath seek
+command = [repoCommand "drop" paramPaths seek
"indicate content of files not currently wanted"]
seek :: [CommandSeek]
diff --git a/Command/Find.hs b/Command/Find.hs
index 0716c5297..0ff68b7ed 100644
--- a/Command/Find.hs
+++ b/Command/Find.hs
@@ -14,8 +14,7 @@ import Content
import Utility.Conditional
command :: [Command]
-command = [repoCommand "find" (paramOptional $ paramRepeating paramPath) seek
- "lists available files"]
+command = [repoCommand "find" paramPaths seek "lists available files"]
seek :: [CommandSeek]
seek = [withFilesInGit start]
diff --git a/Command/Fix.hs b/Command/Fix.hs
index b24f8e33c..0044052e9 100644
--- a/Command/Fix.hs
+++ b/Command/Fix.hs
@@ -19,7 +19,7 @@ import Content
import Messages
command :: [Command]
-command = [repoCommand "fix" paramPath seek
+command = [repoCommand "fix" paramPaths seek
"fix up symlinks to point to annexed content"]
seek :: [CommandSeek]
diff --git a/Command/Fsck.hs b/Command/Fsck.hs
index 08bf2b97f..4e8eeb043 100644
--- a/Command/Fsck.hs
+++ b/Command/Fsck.hs
@@ -30,8 +30,7 @@ import Utility.Path
import Config
command :: [Command]
-command = [repoCommand "fsck" (paramOptional $ paramRepeating paramPath) seek
- "check for problems"]
+command = [repoCommand "fsck" paramPaths seek "check for problems"]
seek :: [CommandSeek]
seek = [withNumCopies start]
diff --git a/Command/Get.hs b/Command/Get.hs
index 1a50158e3..358105cac 100644
--- a/Command/Get.hs
+++ b/Command/Get.hs
@@ -17,7 +17,7 @@ import Utility
import qualified Command.Move
command :: [Command]
-command = [repoCommand "get" paramPath seek
+command = [repoCommand "get" paramPaths seek
"make content of annexed files available"]
seek :: [CommandSeek]
diff --git a/Command/Lock.hs b/Command/Lock.hs
index 77d1ff94f..07721e937 100644
--- a/Command/Lock.hs
+++ b/Command/Lock.hs
@@ -16,7 +16,7 @@ import qualified AnnexQueue
import Utility.SafeCommand
command :: [Command]
-command = [repoCommand "lock" paramPath seek "undo unlock command"]
+command = [repoCommand "lock" paramPaths seek "undo unlock command"]
seek :: [CommandSeek]
seek = [withFilesUnlocked start, withFilesUnlockedToBeCommitted start]
diff --git a/Command/Migrate.hs b/Command/Migrate.hs
index 6ad7e239c..ec570acb7 100644
--- a/Command/Migrate.hs
+++ b/Command/Migrate.hs
@@ -25,7 +25,8 @@ import Utility.Conditional
import qualified Command.Add
command :: [Command]
-command = [repoCommand "migrate" paramPath seek "switch data to different backend"]
+command = [repoCommand "migrate" paramPaths seek
+ "switch data to different backend"]
seek :: [CommandSeek]
seek = [withBackendFilesInGit start]
diff --git a/Command/Move.hs b/Command/Move.hs
index a081a863f..88da92f0a 100644
--- a/Command/Move.hs
+++ b/Command/Move.hs
@@ -20,7 +20,7 @@ import UUID
import Messages
command :: [Command]
-command = [repoCommand "move" paramPath seek
+command = [repoCommand "move" paramPaths seek
"move content of files to/from another repository"]
seek :: [CommandSeek]
diff --git a/Command/PreCommit.hs b/Command/PreCommit.hs
index 3046d3562..6884a4787 100644
--- a/Command/PreCommit.hs
+++ b/Command/PreCommit.hs
@@ -12,7 +12,7 @@ import qualified Command.Add
import qualified Command.Fix
command :: [Command]
-command = [repoCommand "pre-commit" paramPath seek "run by git pre-commit hook"]
+command = [repoCommand "pre-commit" paramPaths seek "run by git pre-commit hook"]
{- The pre-commit hook needs to fix symlinks to all files being committed.
- And, it needs to inject unlocked files into the annex. -}
diff --git a/Command/Unannex.hs b/Command/Unannex.hs
index 54ef2fc68..748da4066 100644
--- a/Command/Unannex.hs
+++ b/Command/Unannex.hs
@@ -27,7 +27,7 @@ import Messages
import Locations
command :: [Command]
-command = [repoCommand "unannex" paramPath seek "undo accidential add command"]
+command = [repoCommand "unannex" paramPaths seek "undo accidential add command"]
seek :: [CommandSeek]
seek = [withFilesInGit start]
diff --git a/Command/Uninit.hs b/Command/Uninit.hs
index fadae0e5a..4c70ec80c 100644
--- a/Command/Uninit.hs
+++ b/Command/Uninit.hs
@@ -22,7 +22,7 @@ import Content
import Locations
command :: [Command]
-command = [repoCommand "uninit" paramPath seek
+command = [repoCommand "uninit" paramPaths seek
"de-initialize git-annex and clean out repository"]
seek :: [CommandSeek]
diff --git a/Command/Unlock.hs b/Command/Unlock.hs
index 0daf1b321..ba6d02387 100644
--- a/Command/Unlock.hs
+++ b/Command/Unlock.hs
@@ -22,8 +22,8 @@ import Utility.Path
command :: [Command]
command =
- [ repoCommand "unlock" paramPath seek "unlock files for modification"
- , repoCommand "edit" paramPath seek "same as unlock"
+ [ repoCommand "unlock" paramPaths seek "unlock files for modification"
+ , repoCommand "edit" paramPaths seek "same as unlock"
]
seek :: [CommandSeek]
diff --git a/Command/Whereis.hs b/Command/Whereis.hs
index ef4303b3a..7d0ab188c 100644
--- a/Command/Whereis.hs
+++ b/Command/Whereis.hs
@@ -17,7 +17,7 @@ import Types
import Trust
command :: [Command]
-command = [repoCommand "whereis" (paramOptional $ paramRepeating paramPath) seek
+command = [repoCommand "whereis" paramPaths seek
"lists repositories that have file content"]
seek :: [CommandSeek]