clean up params in usage display
This commit is contained in:
parent
984c9fc052
commit
9fe3c6d211
16 changed files with 25 additions and 24 deletions
14
Command.hs
14
Command.hs
|
@ -212,12 +212,8 @@ notSymlink :: FilePath -> IO Bool
|
||||||
notSymlink f = liftIO $ not . isSymbolicLink <$> getSymbolicLinkStatus f
|
notSymlink f = liftIO $ not . isSymbolicLink <$> getSymbolicLinkStatus f
|
||||||
|
|
||||||
{- Descriptions of params used in usage messages. -}
|
{- Descriptions of params used in usage messages. -}
|
||||||
paramRepeating :: String -> String
|
paramPaths :: String
|
||||||
paramRepeating s = s ++ " ..."
|
paramPaths = paramOptional $ paramRepeating paramPath -- most often used
|
||||||
paramOptional :: String -> String
|
|
||||||
paramOptional s = "[" ++ s ++ "]"
|
|
||||||
paramPair :: String -> String -> String
|
|
||||||
paramPair a b = a ++ " " ++ b
|
|
||||||
paramPath :: String
|
paramPath :: String
|
||||||
paramPath = "PATH"
|
paramPath = "PATH"
|
||||||
paramKey :: String
|
paramKey :: String
|
||||||
|
@ -240,6 +236,12 @@ paramKeyValue :: String
|
||||||
paramKeyValue = "K=V"
|
paramKeyValue = "K=V"
|
||||||
paramNothing :: String
|
paramNothing :: String
|
||||||
paramNothing = ""
|
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. -}
|
{- The Key specified by the --key parameter. -}
|
||||||
cmdlineKey :: Annex Key
|
cmdlineKey :: Annex Key
|
||||||
|
|
|
@ -29,7 +29,7 @@ import Utility.SafeCommand
|
||||||
import Locations
|
import Locations
|
||||||
|
|
||||||
command :: [Command]
|
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. -}
|
{- Add acts on both files not checked into git yet, and unlocked files. -}
|
||||||
seek :: [CommandSeek]
|
seek :: [CommandSeek]
|
||||||
|
|
|
@ -11,7 +11,7 @@ import Command
|
||||||
import qualified Command.Move
|
import qualified Command.Move
|
||||||
|
|
||||||
command :: [Command]
|
command :: [Command]
|
||||||
command = [repoCommand "copy" paramPath seek
|
command = [repoCommand "copy" paramPaths seek
|
||||||
"copy content of files to/from another repository"]
|
"copy content of files to/from another repository"]
|
||||||
|
|
||||||
-- A copy is just a move that does not delete the source file.
|
-- A copy is just a move that does not delete the source file.
|
||||||
|
|
|
@ -20,7 +20,7 @@ import Trust
|
||||||
import Config
|
import Config
|
||||||
|
|
||||||
command :: [Command]
|
command :: [Command]
|
||||||
command = [repoCommand "drop" paramPath seek
|
command = [repoCommand "drop" paramPaths seek
|
||||||
"indicate content of files not currently wanted"]
|
"indicate content of files not currently wanted"]
|
||||||
|
|
||||||
seek :: [CommandSeek]
|
seek :: [CommandSeek]
|
||||||
|
|
|
@ -14,8 +14,7 @@ import Content
|
||||||
import Utility.Conditional
|
import Utility.Conditional
|
||||||
|
|
||||||
command :: [Command]
|
command :: [Command]
|
||||||
command = [repoCommand "find" (paramOptional $ paramRepeating paramPath) seek
|
command = [repoCommand "find" paramPaths seek "lists available files"]
|
||||||
"lists available files"]
|
|
||||||
|
|
||||||
seek :: [CommandSeek]
|
seek :: [CommandSeek]
|
||||||
seek = [withFilesInGit start]
|
seek = [withFilesInGit start]
|
||||||
|
|
|
@ -19,7 +19,7 @@ import Content
|
||||||
import Messages
|
import Messages
|
||||||
|
|
||||||
command :: [Command]
|
command :: [Command]
|
||||||
command = [repoCommand "fix" paramPath seek
|
command = [repoCommand "fix" paramPaths seek
|
||||||
"fix up symlinks to point to annexed content"]
|
"fix up symlinks to point to annexed content"]
|
||||||
|
|
||||||
seek :: [CommandSeek]
|
seek :: [CommandSeek]
|
||||||
|
|
|
@ -30,8 +30,7 @@ import Utility.Path
|
||||||
import Config
|
import Config
|
||||||
|
|
||||||
command :: [Command]
|
command :: [Command]
|
||||||
command = [repoCommand "fsck" (paramOptional $ paramRepeating paramPath) seek
|
command = [repoCommand "fsck" paramPaths seek "check for problems"]
|
||||||
"check for problems"]
|
|
||||||
|
|
||||||
seek :: [CommandSeek]
|
seek :: [CommandSeek]
|
||||||
seek = [withNumCopies start]
|
seek = [withNumCopies start]
|
||||||
|
|
|
@ -17,7 +17,7 @@ import Utility
|
||||||
import qualified Command.Move
|
import qualified Command.Move
|
||||||
|
|
||||||
command :: [Command]
|
command :: [Command]
|
||||||
command = [repoCommand "get" paramPath seek
|
command = [repoCommand "get" paramPaths seek
|
||||||
"make content of annexed files available"]
|
"make content of annexed files available"]
|
||||||
|
|
||||||
seek :: [CommandSeek]
|
seek :: [CommandSeek]
|
||||||
|
|
|
@ -16,7 +16,7 @@ import qualified AnnexQueue
|
||||||
import Utility.SafeCommand
|
import Utility.SafeCommand
|
||||||
|
|
||||||
command :: [Command]
|
command :: [Command]
|
||||||
command = [repoCommand "lock" paramPath seek "undo unlock command"]
|
command = [repoCommand "lock" paramPaths seek "undo unlock command"]
|
||||||
|
|
||||||
seek :: [CommandSeek]
|
seek :: [CommandSeek]
|
||||||
seek = [withFilesUnlocked start, withFilesUnlockedToBeCommitted start]
|
seek = [withFilesUnlocked start, withFilesUnlockedToBeCommitted start]
|
||||||
|
|
|
@ -25,7 +25,8 @@ import Utility.Conditional
|
||||||
import qualified Command.Add
|
import qualified Command.Add
|
||||||
|
|
||||||
command :: [Command]
|
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 :: [CommandSeek]
|
||||||
seek = [withBackendFilesInGit start]
|
seek = [withBackendFilesInGit start]
|
||||||
|
|
|
@ -20,7 +20,7 @@ import UUID
|
||||||
import Messages
|
import Messages
|
||||||
|
|
||||||
command :: [Command]
|
command :: [Command]
|
||||||
command = [repoCommand "move" paramPath seek
|
command = [repoCommand "move" paramPaths seek
|
||||||
"move content of files to/from another repository"]
|
"move content of files to/from another repository"]
|
||||||
|
|
||||||
seek :: [CommandSeek]
|
seek :: [CommandSeek]
|
||||||
|
|
|
@ -12,7 +12,7 @@ import qualified Command.Add
|
||||||
import qualified Command.Fix
|
import qualified Command.Fix
|
||||||
|
|
||||||
command :: [Command]
|
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.
|
{- The pre-commit hook needs to fix symlinks to all files being committed.
|
||||||
- And, it needs to inject unlocked files into the annex. -}
|
- And, it needs to inject unlocked files into the annex. -}
|
||||||
|
|
|
@ -27,7 +27,7 @@ import Messages
|
||||||
import Locations
|
import Locations
|
||||||
|
|
||||||
command :: [Command]
|
command :: [Command]
|
||||||
command = [repoCommand "unannex" paramPath seek "undo accidential add command"]
|
command = [repoCommand "unannex" paramPaths seek "undo accidential add command"]
|
||||||
|
|
||||||
seek :: [CommandSeek]
|
seek :: [CommandSeek]
|
||||||
seek = [withFilesInGit start]
|
seek = [withFilesInGit start]
|
||||||
|
|
|
@ -22,7 +22,7 @@ import Content
|
||||||
import Locations
|
import Locations
|
||||||
|
|
||||||
command :: [Command]
|
command :: [Command]
|
||||||
command = [repoCommand "uninit" paramPath seek
|
command = [repoCommand "uninit" paramPaths seek
|
||||||
"de-initialize git-annex and clean out repository"]
|
"de-initialize git-annex and clean out repository"]
|
||||||
|
|
||||||
seek :: [CommandSeek]
|
seek :: [CommandSeek]
|
||||||
|
|
|
@ -22,8 +22,8 @@ import Utility.Path
|
||||||
|
|
||||||
command :: [Command]
|
command :: [Command]
|
||||||
command =
|
command =
|
||||||
[ repoCommand "unlock" paramPath seek "unlock files for modification"
|
[ repoCommand "unlock" paramPaths seek "unlock files for modification"
|
||||||
, repoCommand "edit" paramPath seek "same as unlock"
|
, repoCommand "edit" paramPaths seek "same as unlock"
|
||||||
]
|
]
|
||||||
|
|
||||||
seek :: [CommandSeek]
|
seek :: [CommandSeek]
|
||||||
|
|
|
@ -17,7 +17,7 @@ import Types
|
||||||
import Trust
|
import Trust
|
||||||
|
|
||||||
command :: [Command]
|
command :: [Command]
|
||||||
command = [repoCommand "whereis" (paramOptional $ paramRepeating paramPath) seek
|
command = [repoCommand "whereis" paramPaths seek
|
||||||
"lists repositories that have file content"]
|
"lists repositories that have file content"]
|
||||||
|
|
||||||
seek :: [CommandSeek]
|
seek :: [CommandSeek]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue