add --json-error-messages (not yet implemented)
Added --json-error-messages option, which includes error messages in the json output, rather than outputting them to stderr. The actual rediretion of errors is not implemented yet, this is only the docs and option plumbing. This commit was supported by the NSF-funded DataLad project.
This commit is contained in:
parent
fa65f1d240
commit
6583448bab
46 changed files with 164 additions and 69 deletions
|
@ -19,6 +19,8 @@ git-annex (6.20180113) UNRELEASED; urgency=medium
|
||||||
compile.
|
compile.
|
||||||
* Fix behavior of --json-progress followed by --json, in which
|
* Fix behavior of --json-progress followed by --json, in which
|
||||||
the latter option disabled the former.
|
the latter option disabled the former.
|
||||||
|
* Added --json-error-messages option, which includes error messages
|
||||||
|
in the json output, rather than outputting them to stderr.
|
||||||
|
|
||||||
-- Joey Hess <id@joeyh.name> Wed, 24 Jan 2018 20:42:55 -0400
|
-- Joey Hess <id@joeyh.name> Wed, 24 Jan 2018 20:42:55 -0400
|
||||||
|
|
||||||
|
|
|
@ -191,7 +191,7 @@ annexedMatchingOptions = concat
|
||||||
[ nonWorkTreeMatchingOptions'
|
[ nonWorkTreeMatchingOptions'
|
||||||
, fileMatchingOptions'
|
, fileMatchingOptions'
|
||||||
, combiningOptions
|
, combiningOptions
|
||||||
, [timeLimitOption]
|
, timeLimitOption
|
||||||
]
|
]
|
||||||
|
|
||||||
-- Matching options that don't need to examine work tree files.
|
-- Matching options that don't need to examine work tree files.
|
||||||
|
@ -294,37 +294,51 @@ combiningOptions =
|
||||||
longopt o h = globalFlag (Limit.addToken o) ( long o <> help h <> hidden )
|
longopt o h = globalFlag (Limit.addToken o) ( long o <> help h <> hidden )
|
||||||
shortopt o h = globalFlag (Limit.addToken [o]) ( short o <> help h <> hidden )
|
shortopt o h = globalFlag (Limit.addToken [o]) ( short o <> help h <> hidden )
|
||||||
|
|
||||||
jsonOption :: GlobalOption
|
jsonOptions :: [GlobalOption]
|
||||||
jsonOption = globalFlag (Annex.setOutput (JSONOutput jsonoptions))
|
jsonOptions =
|
||||||
|
[ globalFlag (Annex.setOutput (JSONOutput stdjsonoptions))
|
||||||
( long "json" <> short 'j'
|
( long "json" <> short 'j'
|
||||||
<> help "enable JSON output"
|
<> help "enable JSON output"
|
||||||
<> hidden
|
<> hidden
|
||||||
)
|
)
|
||||||
|
, globalFlag (Annex.setOutput (JSONOutput jsonerrormessagesoptions))
|
||||||
|
( long "json-error-messages"
|
||||||
|
<> help "include error messages in JSON"
|
||||||
|
<> hidden
|
||||||
|
)
|
||||||
|
]
|
||||||
where
|
where
|
||||||
jsonoptions = JSONOptions
|
stdjsonoptions = JSONOptions
|
||||||
{ jsonProgress = False
|
{ jsonProgress = False
|
||||||
|
, jsonErrorMessages = False
|
||||||
}
|
}
|
||||||
|
jsonerrormessagesoptions = stdjsonoptions { jsonErrorMessages = True }
|
||||||
|
|
||||||
jsonProgressOption :: GlobalOption
|
jsonProgressOption :: [GlobalOption]
|
||||||
jsonProgressOption = globalFlag (Annex.setOutput (JSONOutput jsonoptions))
|
jsonProgressOption =
|
||||||
|
[ globalFlag (Annex.setOutput (JSONOutput jsonoptions))
|
||||||
( long "json-progress"
|
( long "json-progress"
|
||||||
<> help "include progress in JSON output"
|
<> help "include progress in JSON output"
|
||||||
<> hidden
|
<> hidden
|
||||||
)
|
)
|
||||||
|
]
|
||||||
where
|
where
|
||||||
jsonoptions = JSONOptions
|
jsonoptions = JSONOptions
|
||||||
{ jsonProgress = True
|
{ jsonProgress = True
|
||||||
|
, jsonErrorMessages = False
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Note that a command that adds this option should wrap its seek
|
-- Note that a command that adds this option should wrap its seek
|
||||||
-- action in `allowConcurrentOutput`.
|
-- action in `allowConcurrentOutput`.
|
||||||
jobsOption :: GlobalOption
|
jobsOption :: [GlobalOption]
|
||||||
jobsOption = globalSetter set $
|
jobsOption =
|
||||||
|
[ globalSetter set $
|
||||||
option auto
|
option auto
|
||||||
( long "jobs" <> short 'J' <> metavar paramNumber
|
( long "jobs" <> short 'J' <> metavar paramNumber
|
||||||
<> help "enable concurrent jobs"
|
<> help "enable concurrent jobs"
|
||||||
<> hidden
|
<> hidden
|
||||||
)
|
)
|
||||||
|
]
|
||||||
where
|
where
|
||||||
set n = do
|
set n = do
|
||||||
Annex.changeState $ \s -> s { Annex.concurrency = Concurrent n }
|
Annex.changeState $ \s -> s { Annex.concurrency = Concurrent n }
|
||||||
|
@ -332,12 +346,14 @@ jobsOption = globalSetter set $
|
||||||
when (n > c) $
|
when (n > c) $
|
||||||
liftIO $ setNumCapabilities n
|
liftIO $ setNumCapabilities n
|
||||||
|
|
||||||
timeLimitOption :: GlobalOption
|
timeLimitOption :: [GlobalOption]
|
||||||
timeLimitOption = globalSetter Limit.addTimeLimit $ strOption
|
timeLimitOption =
|
||||||
|
[ globalSetter Limit.addTimeLimit $ strOption
|
||||||
( long "time-limit" <> short 'T' <> metavar paramTime
|
( long "time-limit" <> short 'T' <> metavar paramTime
|
||||||
<> help "stop after the specified amount of time"
|
<> help "stop after the specified amount of time"
|
||||||
<> hidden
|
<> hidden
|
||||||
)
|
)
|
||||||
|
]
|
||||||
|
|
||||||
data DaemonOptions = DaemonOptions
|
data DaemonOptions = DaemonOptions
|
||||||
{ foregroundDaemonOption :: Bool
|
{ foregroundDaemonOption :: Bool
|
||||||
|
|
|
@ -79,9 +79,9 @@ allowMessages = do
|
||||||
noRepo :: (String -> Parser (IO ())) -> Command -> Command
|
noRepo :: (String -> Parser (IO ())) -> Command -> Command
|
||||||
noRepo a c = c { cmdnorepo = Just (a (cmdparamdesc c)) }
|
noRepo a c = c { cmdnorepo = Just (a (cmdparamdesc c)) }
|
||||||
|
|
||||||
{- Adds global options to a command's. -}
|
{- Adds global options to a command. -}
|
||||||
withGlobalOptions :: [GlobalOption] -> Command -> Command
|
withGlobalOptions :: [[GlobalOption]] -> Command -> Command
|
||||||
withGlobalOptions os c = c { cmdglobaloptions = cmdglobaloptions c ++ os }
|
withGlobalOptions os c = c { cmdglobaloptions = cmdglobaloptions c ++ concat os }
|
||||||
|
|
||||||
{- For start and perform stages to indicate what step to run next. -}
|
{- For start and perform stages to indicate what step to run next. -}
|
||||||
next :: a -> Annex (Maybe a)
|
next :: a -> Annex (Maybe a)
|
||||||
|
|
|
@ -22,7 +22,8 @@ import Annex.Version
|
||||||
import Git.FilePath
|
import Git.FilePath
|
||||||
|
|
||||||
cmd :: Command
|
cmd :: Command
|
||||||
cmd = notBareRepo $ withGlobalOptions (jobsOption : jsonOption : fileMatchingOptions) $
|
cmd = notBareRepo $
|
||||||
|
withGlobalOptions [jobsOption, jsonOptions, fileMatchingOptions] $
|
||||||
command "add" SectionCommon "add files to annex"
|
command "add" SectionCommon "add files to annex"
|
||||||
paramPaths (seek <$$> optParser)
|
paramPaths (seek <$$> optParser)
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ import Utility.Path.Max
|
||||||
import qualified Annex.Transfer as Transfer
|
import qualified Annex.Transfer as Transfer
|
||||||
|
|
||||||
cmd :: Command
|
cmd :: Command
|
||||||
cmd = notBareRepo $ withGlobalOptions [jobsOption, jsonOption, jsonProgressOption] $
|
cmd = notBareRepo $ withGlobalOptions [jobsOption, jsonOptions, jsonProgressOption] $
|
||||||
command "addurl" SectionCommon "add urls to annex"
|
command "addurl" SectionCommon "add urls to annex"
|
||||||
(paramRepeating paramUrl) (seek <$$> optParser)
|
(paramRepeating paramUrl) (seek <$$> optParser)
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ import Annex.Wanted
|
||||||
import Annex.NumCopies
|
import Annex.NumCopies
|
||||||
|
|
||||||
cmd :: Command
|
cmd :: Command
|
||||||
cmd = withGlobalOptions (jobsOption : jsonOption : jsonProgressOption : annexedMatchingOptions) $
|
cmd = withGlobalOptions [jobsOption, jsonOptions, jsonProgressOption, annexedMatchingOptions] $
|
||||||
command "copy" SectionCommon
|
command "copy" SectionCommon
|
||||||
"copy content of files to/from another repository"
|
"copy content of files to/from another repository"
|
||||||
paramPaths (seek <--< optParser)
|
paramPaths (seek <--< optParser)
|
||||||
|
|
|
@ -23,7 +23,7 @@ import System.Log.Logger (debugM)
|
||||||
import qualified Data.Set as S
|
import qualified Data.Set as S
|
||||||
|
|
||||||
cmd :: Command
|
cmd :: Command
|
||||||
cmd = withGlobalOptions (jobsOption : jsonOption : annexedMatchingOptions) $
|
cmd = withGlobalOptions [jobsOption, jsonOptions, annexedMatchingOptions] $
|
||||||
command "drop" SectionCommon
|
command "drop" SectionCommon
|
||||||
"remove content of files from repository"
|
"remove content of files from repository"
|
||||||
paramPaths (seek <$$> optParser)
|
paramPaths (seek <$$> optParser)
|
||||||
|
|
|
@ -13,7 +13,7 @@ import Logs.Location
|
||||||
import Annex.Content
|
import Annex.Content
|
||||||
|
|
||||||
cmd :: Command
|
cmd :: Command
|
||||||
cmd = noCommit $ withGlobalOptions [jsonOption] $
|
cmd = noCommit $ withGlobalOptions [jsonOptions] $
|
||||||
command "dropkey" SectionPlumbing
|
command "dropkey" SectionPlumbing
|
||||||
"drops annexed content for specified keys"
|
"drops annexed content for specified keys"
|
||||||
(paramRepeating paramKey)
|
(paramRepeating paramKey)
|
||||||
|
|
|
@ -13,7 +13,7 @@ import Command.Find (parseFormatOption, showFormatted, keyVars)
|
||||||
|
|
||||||
cmd :: Command
|
cmd :: Command
|
||||||
cmd = noCommit $ noMessages $ dontCheck repoExists $
|
cmd = noCommit $ noMessages $ dontCheck repoExists $
|
||||||
withGlobalOptions [jsonOption] $
|
withGlobalOptions [jsonOptions] $
|
||||||
command "examinekey" SectionPlumbing
|
command "examinekey" SectionPlumbing
|
||||||
"prints information from a key"
|
"prints information from a key"
|
||||||
(paramRepeating paramKey)
|
(paramRepeating paramKey)
|
||||||
|
|
|
@ -18,12 +18,12 @@ import qualified Utility.Format
|
||||||
import Utility.DataUnits
|
import Utility.DataUnits
|
||||||
|
|
||||||
cmd :: Command
|
cmd :: Command
|
||||||
cmd = withGlobalOptions annexedMatchingOptions $ mkCommand $
|
cmd = withGlobalOptions [annexedMatchingOptions] $ mkCommand $
|
||||||
command "find" SectionQuery "lists available files"
|
command "find" SectionQuery "lists available files"
|
||||||
paramPaths (seek <$$> optParser)
|
paramPaths (seek <$$> optParser)
|
||||||
|
|
||||||
mkCommand :: Command -> Command
|
mkCommand :: Command -> Command
|
||||||
mkCommand = noCommit . noMessages . withGlobalOptions [jsonOption]
|
mkCommand = noCommit . noMessages . withGlobalOptions [jsonOptions]
|
||||||
|
|
||||||
data FindOptions = FindOptions
|
data FindOptions = FindOptions
|
||||||
{ findThese :: CmdParams
|
{ findThese :: CmdParams
|
||||||
|
|
|
@ -12,7 +12,7 @@ import qualified Command.Find as Find
|
||||||
import qualified Git
|
import qualified Git
|
||||||
|
|
||||||
cmd :: Command
|
cmd :: Command
|
||||||
cmd = withGlobalOptions nonWorkTreeMatchingOptions $ Find.mkCommand $
|
cmd = withGlobalOptions [nonWorkTreeMatchingOptions] $ Find.mkCommand $
|
||||||
command "findref" SectionPlumbing
|
command "findref" SectionPlumbing
|
||||||
"lists files in a git ref"
|
"lists files in a git ref"
|
||||||
paramRef (seek <$$> Find.optParser)
|
paramRef (seek <$$> Find.optParser)
|
||||||
|
|
|
@ -23,7 +23,7 @@ import Utility.Touch
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
cmd :: Command
|
cmd :: Command
|
||||||
cmd = notDirect $ noCommit $ withGlobalOptions annexedMatchingOptions $
|
cmd = notDirect $ noCommit $ withGlobalOptions [annexedMatchingOptions] $
|
||||||
command "fix" SectionMaintenance
|
command "fix" SectionMaintenance
|
||||||
"fix up links to annexed content"
|
"fix up links to annexed content"
|
||||||
paramPaths (withParams seek)
|
paramPaths (withParams seek)
|
||||||
|
|
|
@ -45,7 +45,7 @@ import qualified Data.Set as S
|
||||||
import qualified Data.Map as M
|
import qualified Data.Map as M
|
||||||
|
|
||||||
cmd :: Command
|
cmd :: Command
|
||||||
cmd = withGlobalOptions (jobsOption : jsonOption : annexedMatchingOptions) $
|
cmd = withGlobalOptions [jobsOption, jsonOptions, annexedMatchingOptions] $
|
||||||
command "fsck" SectionMaintenance
|
command "fsck" SectionMaintenance
|
||||||
"find and fix problems"
|
"find and fix problems"
|
||||||
paramPaths (seek <$$> optParser)
|
paramPaths (seek <$$> optParser)
|
||||||
|
|
|
@ -16,7 +16,7 @@ import Annex.Wanted
|
||||||
import qualified Command.Move
|
import qualified Command.Move
|
||||||
|
|
||||||
cmd :: Command
|
cmd :: Command
|
||||||
cmd = withGlobalOptions (jobsOption : jsonOption : jsonProgressOption : annexedMatchingOptions) $
|
cmd = withGlobalOptions [jobsOption, jsonOptions, jsonProgressOption, annexedMatchingOptions] $
|
||||||
command "get" SectionCommon
|
command "get" SectionCommon
|
||||||
"make content of annexed files available"
|
"make content of annexed files available"
|
||||||
paramPaths (seek <$$> optParser)
|
paramPaths (seek <$$> optParser)
|
||||||
|
|
|
@ -24,7 +24,8 @@ import Utility.InodeCache
|
||||||
import Logs.Location
|
import Logs.Location
|
||||||
|
|
||||||
cmd :: Command
|
cmd :: Command
|
||||||
cmd = withGlobalOptions (jobsOption : jsonOption : fileMatchingOptions) $ notBareRepo $
|
cmd = notBareRepo $
|
||||||
|
withGlobalOptions [jobsOption, jsonOptions, fileMatchingOptions] $
|
||||||
command "import" SectionCommon
|
command "import" SectionCommon
|
||||||
"move and add files from outside git working copy"
|
"move and add files from outside git working copy"
|
||||||
paramPaths (seek <$$> optParser)
|
paramPaths (seek <$$> optParser)
|
||||||
|
|
|
@ -84,7 +84,7 @@ emptyStatInfo = StatInfo Nothing Nothing M.empty Nothing
|
||||||
type StatState = StateT StatInfo Annex
|
type StatState = StateT StatInfo Annex
|
||||||
|
|
||||||
cmd :: Command
|
cmd :: Command
|
||||||
cmd = noCommit $ withGlobalOptions (jsonOption : annexedMatchingOptions) $
|
cmd = noCommit $ withGlobalOptions [jsonOptions, annexedMatchingOptions] $
|
||||||
command "info" SectionQuery
|
command "info" SectionQuery
|
||||||
"shows information about the specified item or the repository as a whole"
|
"shows information about the specified item or the repository as a whole"
|
||||||
(paramRepeating paramItem) (seek <$$> optParser)
|
(paramRepeating paramItem) (seek <$$> optParser)
|
||||||
|
|
|
@ -22,7 +22,7 @@ import Git.Types (RemoteName)
|
||||||
import Utility.Tuple
|
import Utility.Tuple
|
||||||
|
|
||||||
cmd :: Command
|
cmd :: Command
|
||||||
cmd = noCommit $ withGlobalOptions annexedMatchingOptions $
|
cmd = noCommit $ withGlobalOptions [annexedMatchingOptions] $
|
||||||
command "list" SectionQuery
|
command "list" SectionQuery
|
||||||
"show which remotes contain files"
|
"show which remotes contain files"
|
||||||
paramPaths (seek <$$> optParser)
|
paramPaths (seek <$$> optParser)
|
||||||
|
|
|
@ -23,7 +23,7 @@ import Logs.Location
|
||||||
import Git.FilePath
|
import Git.FilePath
|
||||||
|
|
||||||
cmd :: Command
|
cmd :: Command
|
||||||
cmd = notDirect $ withGlobalOptions (jsonOption : annexedMatchingOptions) $
|
cmd = notDirect $ withGlobalOptions [jsonOptions, annexedMatchingOptions] $
|
||||||
command "lock" SectionCommon
|
command "lock" SectionCommon
|
||||||
"undo unlock command"
|
"undo unlock command"
|
||||||
paramPaths (withParams seek)
|
paramPaths (withParams seek)
|
||||||
|
|
|
@ -40,7 +40,7 @@ data LogChange = Added | Removed
|
||||||
type Outputter = LogChange -> POSIXTime -> [UUID] -> Annex ()
|
type Outputter = LogChange -> POSIXTime -> [UUID] -> Annex ()
|
||||||
|
|
||||||
cmd :: Command
|
cmd :: Command
|
||||||
cmd = withGlobalOptions annexedMatchingOptions $
|
cmd = withGlobalOptions [annexedMatchingOptions] $
|
||||||
command "log" SectionQuery "shows location log"
|
command "log" SectionQuery "shows location log"
|
||||||
paramPaths (seek <$$> optParser)
|
paramPaths (seek <$$> optParser)
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ import Data.Aeson
|
||||||
import Control.Concurrent
|
import Control.Concurrent
|
||||||
|
|
||||||
cmd :: Command
|
cmd :: Command
|
||||||
cmd = withGlobalOptions ([jsonOption] ++ annexedMatchingOptions) $
|
cmd = withGlobalOptions [jsonOptions, annexedMatchingOptions] $
|
||||||
command "metadata" SectionMetaData
|
command "metadata" SectionMetaData
|
||||||
"sets or gets metadata of a file"
|
"sets or gets metadata of a file"
|
||||||
paramPaths (seek <$$> optParser)
|
paramPaths (seek <$$> optParser)
|
||||||
|
|
|
@ -20,7 +20,7 @@ import Logs.Web
|
||||||
import qualified Remote
|
import qualified Remote
|
||||||
|
|
||||||
cmd :: Command
|
cmd :: Command
|
||||||
cmd = notDirect $ withGlobalOptions annexedMatchingOptions $
|
cmd = notDirect $ withGlobalOptions [annexedMatchingOptions] $
|
||||||
command "migrate" SectionUtility
|
command "migrate" SectionUtility
|
||||||
"switch data to different backend"
|
"switch data to different backend"
|
||||||
paramPaths (withParams seek)
|
paramPaths (withParams seek)
|
||||||
|
|
|
@ -17,7 +17,7 @@ import Annex.NumCopies
|
||||||
import Types.Transfer
|
import Types.Transfer
|
||||||
|
|
||||||
cmd :: Command
|
cmd :: Command
|
||||||
cmd = withGlobalOptions (jobsOption : jsonOption : jsonProgressOption : annexedMatchingOptions) $
|
cmd = withGlobalOptions [jobsOption, jsonOptions, jsonProgressOption, annexedMatchingOptions] $
|
||||||
command "mirror" SectionCommon
|
command "mirror" SectionCommon
|
||||||
"mirror content of files to/from another repository"
|
"mirror content of files to/from another repository"
|
||||||
paramPaths (seek <--< optParser)
|
paramPaths (seek <--< optParser)
|
||||||
|
|
|
@ -20,7 +20,7 @@ import Annex.NumCopies
|
||||||
import System.Log.Logger (debugM)
|
import System.Log.Logger (debugM)
|
||||||
|
|
||||||
cmd :: Command
|
cmd :: Command
|
||||||
cmd = withGlobalOptions (jobsOption : jsonOption : jsonProgressOption : annexedMatchingOptions) $
|
cmd = withGlobalOptions [jobsOption, jsonOptions, jsonProgressOption, annexedMatchingOptions] $
|
||||||
command "move" SectionCommon
|
command "move" SectionCommon
|
||||||
"move content of files to/from another repository"
|
"move content of files to/from another repository"
|
||||||
paramPaths (seek <--< optParser)
|
paramPaths (seek <--< optParser)
|
||||||
|
|
|
@ -17,7 +17,7 @@ import Git.FilePath
|
||||||
|
|
||||||
cmd :: Command
|
cmd :: Command
|
||||||
cmd = notBareRepo $ noCommit $ noMessages $
|
cmd = notBareRepo $ noCommit $ noMessages $
|
||||||
withGlobalOptions [jsonOption] $
|
withGlobalOptions [jsonOptions] $
|
||||||
command "status" SectionCommon
|
command "status" SectionCommon
|
||||||
"show the working tree status"
|
"show the working tree status"
|
||||||
paramPaths (seek <$$> optParser)
|
paramPaths (seek <$$> optParser)
|
||||||
|
|
|
@ -24,7 +24,7 @@ import qualified Database.Keys
|
||||||
import Git.FilePath
|
import Git.FilePath
|
||||||
|
|
||||||
cmd :: Command
|
cmd :: Command
|
||||||
cmd = withGlobalOptions annexedMatchingOptions $
|
cmd = withGlobalOptions [annexedMatchingOptions] $
|
||||||
command "unannex" SectionUtility
|
command "unannex" SectionUtility
|
||||||
"undo accidental add command"
|
"undo accidental add command"
|
||||||
paramPaths (withParams seek)
|
paramPaths (withParams seek)
|
||||||
|
|
|
@ -26,7 +26,8 @@ editcmd :: Command
|
||||||
editcmd = mkcmd "edit" "same as unlock"
|
editcmd = mkcmd "edit" "same as unlock"
|
||||||
|
|
||||||
mkcmd :: String -> String -> Command
|
mkcmd :: String -> String -> Command
|
||||||
mkcmd n d = notDirect $ withGlobalOptions (jsonOption : annexedMatchingOptions) $
|
mkcmd n d = notDirect $
|
||||||
|
withGlobalOptions [jsonOptions, annexedMatchingOptions] $
|
||||||
command n SectionCommon d paramPaths (withParams seek)
|
command n SectionCommon d paramPaths (withParams seek)
|
||||||
|
|
||||||
seek :: CmdParams -> CommandSeek
|
seek :: CmdParams -> CommandSeek
|
||||||
|
|
|
@ -17,7 +17,7 @@ import Annex.UUID
|
||||||
import qualified Data.Map as M
|
import qualified Data.Map as M
|
||||||
|
|
||||||
cmd :: Command
|
cmd :: Command
|
||||||
cmd = noCommit $ withGlobalOptions (jsonOption : annexedMatchingOptions) $
|
cmd = noCommit $ withGlobalOptions [jsonOptions, annexedMatchingOptions] $
|
||||||
command "whereis" SectionQuery
|
command "whereis" SectionQuery
|
||||||
"lists repositories that have file content"
|
"lists repositories that have file content"
|
||||||
paramPaths (seek <$$> optParser)
|
paramPaths (seek <$$> optParser)
|
||||||
|
|
|
@ -21,12 +21,14 @@ data OutputType = NormalOutput | QuietOutput | JSONOutput JSONOptions
|
||||||
|
|
||||||
data JSONOptions = JSONOptions
|
data JSONOptions = JSONOptions
|
||||||
{ jsonProgress :: Bool
|
{ jsonProgress :: Bool
|
||||||
|
, jsonErrorMessages :: Bool
|
||||||
}
|
}
|
||||||
deriving (Show)
|
deriving (Show)
|
||||||
|
|
||||||
adjustOutputType :: OutputType -> OutputType -> OutputType
|
adjustOutputType :: OutputType -> OutputType -> OutputType
|
||||||
adjustOutputType (JSONOutput old) (JSONOutput new) = JSONOutput $ JSONOptions
|
adjustOutputType (JSONOutput old) (JSONOutput new) = JSONOutput $ JSONOptions
|
||||||
{ jsonProgress = jsonProgress old || jsonProgress new
|
{ jsonProgress = jsonProgress old || jsonProgress new
|
||||||
|
, jsonErrorMessages = jsonErrorMessages old || jsonErrorMessages new
|
||||||
}
|
}
|
||||||
adjustOutputType _old new = new
|
adjustOutputType _old new = new
|
||||||
|
|
||||||
|
|
|
@ -66,6 +66,10 @@ annexed content, and other symlinks.
|
||||||
Enable JSON output. This is intended to be parsed by programs that use
|
Enable JSON output. This is intended to be parsed by programs that use
|
||||||
git-annex. Each line of output is a JSON object.
|
git-annex. Each line of output is a JSON object.
|
||||||
|
|
||||||
|
* `--json-error-messages`
|
||||||
|
|
||||||
|
Include any error messages in the json, rather than output to stderr.
|
||||||
|
|
||||||
* `--batch`
|
* `--batch`
|
||||||
|
|
||||||
Enables batch mode, in which a file to add is read in a line from stdin,
|
Enables batch mode, in which a file to add is read in a line from stdin,
|
||||||
|
|
|
@ -97,6 +97,10 @@ be used to get better filenames.
|
||||||
|
|
||||||
Include progress objects in JSON output.
|
Include progress objects in JSON output.
|
||||||
|
|
||||||
|
* `--json-error-messages`
|
||||||
|
|
||||||
|
Include any error messages in the json, rather than output to stderr.
|
||||||
|
|
||||||
# CAVEATS
|
# CAVEATS
|
||||||
|
|
||||||
If annex.largefiles is configured, and does not match a file, `git annex
|
If annex.largefiles is configured, and does not match a file, `git annex
|
||||||
|
|
|
@ -97,6 +97,10 @@ Copies the content of files from or to another remote.
|
||||||
|
|
||||||
Include progress objects in JSON output.
|
Include progress objects in JSON output.
|
||||||
|
|
||||||
|
* `--json-error-messages`
|
||||||
|
|
||||||
|
Include any error messages in the json, rather than output to stderr.
|
||||||
|
|
||||||
# SEE ALSO
|
# SEE ALSO
|
||||||
|
|
||||||
[[git-annex]](1)
|
[[git-annex]](1)
|
||||||
|
|
|
@ -87,6 +87,10 @@ safe to do so.
|
||||||
Enable JSON output. This is intended to be parsed by programs that use
|
Enable JSON output. This is intended to be parsed by programs that use
|
||||||
git-annex. Each line of output is a JSON object.
|
git-annex. Each line of output is a JSON object.
|
||||||
|
|
||||||
|
* `--json-error-messages`
|
||||||
|
|
||||||
|
Include any error messages in the json, rather than output to stderr.
|
||||||
|
|
||||||
# SEE ALSO
|
# SEE ALSO
|
||||||
|
|
||||||
[[git-annex]](1)
|
[[git-annex]](1)
|
||||||
|
|
|
@ -29,6 +29,10 @@ exist; using it can easily result in data loss.
|
||||||
Enable JSON output. This is intended to be parsed by programs that use
|
Enable JSON output. This is intended to be parsed by programs that use
|
||||||
git-annex. Each line of output is a JSON object.
|
git-annex. Each line of output is a JSON object.
|
||||||
|
|
||||||
|
* `--json-error-messages`
|
||||||
|
|
||||||
|
Include any error messages in the json, rather than output to stderr.
|
||||||
|
|
||||||
# SEE ALSO
|
# SEE ALSO
|
||||||
|
|
||||||
[[git-annex]](1)
|
[[git-annex]](1)
|
||||||
|
|
|
@ -33,6 +33,10 @@ that can be determined purely by looking at the key.
|
||||||
Enable JSON output. This is intended to be parsed by programs that use
|
Enable JSON output. This is intended to be parsed by programs that use
|
||||||
git-annex. Each line of output is a JSON object.
|
git-annex. Each line of output is a JSON object.
|
||||||
|
|
||||||
|
* `--json-error-messages`
|
||||||
|
|
||||||
|
Include any error messages in the json, rather than output to stderr.
|
||||||
|
|
||||||
* `--batch`
|
* `--batch`
|
||||||
|
|
||||||
Enable batch mode, in which a line containing a key is read from stdin,
|
Enable batch mode, in which a line containing a key is read from stdin,
|
||||||
|
|
|
@ -54,6 +54,10 @@ finds files in the current directory and its subdirectories.
|
||||||
This is intended to be parsed by programs that use
|
This is intended to be parsed by programs that use
|
||||||
git-annex. Each line of output is a JSON object.
|
git-annex. Each line of output is a JSON object.
|
||||||
|
|
||||||
|
* `--json-error-messages`
|
||||||
|
|
||||||
|
Include any error messages in the json, rather than output to stderr.
|
||||||
|
|
||||||
* `--batch`
|
* `--batch`
|
||||||
|
|
||||||
Enables batch mode, in which a file is read in a line from stdin,
|
Enables batch mode, in which a file is read in a line from stdin,
|
||||||
|
|
|
@ -98,6 +98,10 @@ With parameters, only the specified files are checked.
|
||||||
Enable JSON output. This is intended to be parsed by programs that use
|
Enable JSON output. This is intended to be parsed by programs that use
|
||||||
git-annex. Each line of output is a JSON object.
|
git-annex. Each line of output is a JSON object.
|
||||||
|
|
||||||
|
* `--json-error-messages`
|
||||||
|
|
||||||
|
Include any error messages in the json, rather than output to stderr.
|
||||||
|
|
||||||
# OPTIONS
|
# OPTIONS
|
||||||
|
|
||||||
# SEE ALSO
|
# SEE ALSO
|
||||||
|
|
|
@ -106,6 +106,10 @@ or transferring them from some kind of key-value store.
|
||||||
|
|
||||||
Include progress objects in JSON output.
|
Include progress objects in JSON output.
|
||||||
|
|
||||||
|
* `--json-error-messages`
|
||||||
|
|
||||||
|
Include any error messages in the json, rather than output to stderr.
|
||||||
|
|
||||||
# SEE ALSO
|
# SEE ALSO
|
||||||
|
|
||||||
[[git-annex]](1)
|
[[git-annex]](1)
|
||||||
|
|
|
@ -81,6 +81,10 @@ Several options can be used to adjust handling of duplicate files.
|
||||||
Enable JSON output. This is intended to be parsed by programs that use
|
Enable JSON output. This is intended to be parsed by programs that use
|
||||||
git-annex. Each line of output is a JSON object.
|
git-annex. Each line of output is a JSON object.
|
||||||
|
|
||||||
|
* `--json-error-messages`
|
||||||
|
|
||||||
|
Include any error messages in the json, rather than output to stderr.
|
||||||
|
|
||||||
# CAVEATS
|
# CAVEATS
|
||||||
|
|
||||||
Note that using `--deduplicate` or `--clean-duplicates` with the WORM
|
Note that using `--deduplicate` or `--clean-duplicates` with the WORM
|
||||||
|
|
|
@ -26,6 +26,10 @@ for the repository as a whole.
|
||||||
Enable JSON output. This is intended to be parsed by programs that use
|
Enable JSON output. This is intended to be parsed by programs that use
|
||||||
git-annex. Each line of output is a JSON object.
|
git-annex. Each line of output is a JSON object.
|
||||||
|
|
||||||
|
* `--json-error-messages`
|
||||||
|
|
||||||
|
Include any error messages in the json, rather than output to stderr.
|
||||||
|
|
||||||
* `--bytes`
|
* `--bytes`
|
||||||
|
|
||||||
Show file sizes in bytes, disabling the default nicer units.
|
Show file sizes in bytes, disabling the default nicer units.
|
||||||
|
|
|
@ -23,6 +23,10 @@ the files any longer, or have made modifications you want to discard.
|
||||||
Enable JSON output. This is intended to be parsed by programs that use
|
Enable JSON output. This is intended to be parsed by programs that use
|
||||||
git-annex. Each line of output is a JSON object.
|
git-annex. Each line of output is a JSON object.
|
||||||
|
|
||||||
|
* `--json-error-messages`
|
||||||
|
|
||||||
|
Include any error messages in the json, rather than output to stderr.
|
||||||
|
|
||||||
# SEE ALSO
|
# SEE ALSO
|
||||||
|
|
||||||
[[git-annex]](1)
|
[[git-annex]](1)
|
||||||
|
|
|
@ -112,6 +112,10 @@ automatically.
|
||||||
|
|
||||||
{"command":"metadata","file":"foo","key":"...","author":["bar"],...,"note":"...","success":true}
|
{"command":"metadata","file":"foo","key":"...","author":["bar"],...,"note":"...","success":true}
|
||||||
|
|
||||||
|
* `--json-error-messages`
|
||||||
|
|
||||||
|
Include any error messages in the json, rather than output to stderr.
|
||||||
|
|
||||||
* `--batch`
|
* `--batch`
|
||||||
|
|
||||||
Enables batch mode, which can be used to both get, store, and unset
|
Enables batch mode, which can be used to both get, store, and unset
|
||||||
|
|
|
@ -75,6 +75,10 @@ contents. Use [[git-annex-sync]](1) for that.
|
||||||
|
|
||||||
Include progress objects in JSON output.
|
Include progress objects in JSON output.
|
||||||
|
|
||||||
|
* `--json-error-messages`
|
||||||
|
|
||||||
|
Include any error messages in the json, rather than output to stderr.
|
||||||
|
|
||||||
# SEE ALSO
|
# SEE ALSO
|
||||||
|
|
||||||
[[git-annex]](1)
|
[[git-annex]](1)
|
||||||
|
|
|
@ -92,6 +92,10 @@ Moves the content of files from or to another remote.
|
||||||
|
|
||||||
Include progress objects in JSON output.
|
Include progress objects in JSON output.
|
||||||
|
|
||||||
|
* `--json-error-messages`
|
||||||
|
|
||||||
|
Include any error messages in the json, rather than output to stderr.
|
||||||
|
|
||||||
# SEE ALSO
|
# SEE ALSO
|
||||||
|
|
||||||
[[git-annex]](1)
|
[[git-annex]](1)
|
||||||
|
|
|
@ -18,15 +18,19 @@ Particularly useful in direct mode.
|
||||||
|
|
||||||
# OPTIONS
|
# OPTIONS
|
||||||
|
|
||||||
|
* `--ignore-submodules=when`
|
||||||
|
|
||||||
|
This option is passed on to git status, see its man page for
|
||||||
|
details.
|
||||||
|
|
||||||
* `--json`
|
* `--json`
|
||||||
|
|
||||||
Enable JSON output. This is intended to be parsed by programs that use
|
Enable JSON output. This is intended to be parsed by programs that use
|
||||||
git-annex. Each line of output is a JSON object.
|
git-annex. Each line of output is a JSON object.
|
||||||
|
|
||||||
* `--ignore-submodules=when`
|
* `--json-error-messages`
|
||||||
|
|
||||||
This option is passed on to git status, see its man page for
|
Include any error messages in the json, rather than output to stderr.
|
||||||
details.
|
|
||||||
|
|
||||||
# SEE ALSO
|
# SEE ALSO
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,10 @@ file to be lost from the local repository. So, enable annex.thin with care.
|
||||||
Enable JSON output. This is intended to be parsed by programs that use
|
Enable JSON output. This is intended to be parsed by programs that use
|
||||||
git-annex. Each line of output is a JSON object.
|
git-annex. Each line of output is a JSON object.
|
||||||
|
|
||||||
|
* `--json-error-messages`
|
||||||
|
|
||||||
|
Include any error messages in the json, rather than output to stderr.
|
||||||
|
|
||||||
# SEE ALSO
|
# SEE ALSO
|
||||||
|
|
||||||
[[git-annex]](1)
|
[[git-annex]](1)
|
||||||
|
|
|
@ -43,11 +43,6 @@ For example:
|
||||||
|
|
||||||
Show whereis information for files found by last run of git-annex unused.
|
Show whereis information for files found by last run of git-annex unused.
|
||||||
|
|
||||||
* `--json`
|
|
||||||
|
|
||||||
Enable JSON output. This is intended to be parsed by programs that use
|
|
||||||
git-annex. Each line of output is a JSON object.
|
|
||||||
|
|
||||||
* `--batch`
|
* `--batch`
|
||||||
|
|
||||||
Enables batch mode, in which a file is read in a line from stdin,
|
Enables batch mode, in which a file is read in a line from stdin,
|
||||||
|
@ -56,6 +51,15 @@ For example:
|
||||||
Note that if the file is not an annexed file, an empty line will be
|
Note that if the file is not an annexed file, an empty line will be
|
||||||
output instead.
|
output instead.
|
||||||
|
|
||||||
|
* `--json`
|
||||||
|
|
||||||
|
Enable JSON output. This is intended to be parsed by programs that use
|
||||||
|
git-annex. Each line of output is a JSON object.
|
||||||
|
|
||||||
|
* `--json-error-messages`
|
||||||
|
|
||||||
|
Include any error messages in the json, rather than output to stderr.
|
||||||
|
|
||||||
# SEE ALSO
|
# SEE ALSO
|
||||||
|
|
||||||
[[git-annex]](1)
|
[[git-annex]](1)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue