new improved benchmark command that can benchmark anything git-annex does

This commit is contained in:
Joey Hess 2019-01-04 13:43:53 -04:00
parent 3b3d31583b
commit 11d6e2e260
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
11 changed files with 184 additions and 123 deletions

View file

@ -8,6 +8,8 @@
module CmdLine (
dispatch,
usage,
parseCmd,
prepRunCommand,
) where
import qualified Options.Applicative as O
@ -39,13 +41,7 @@ dispatch fuzzyok allargs allcmds globaloptions fields getgitrepo progname progde
(cmd, seek, globalconfig) <- parsewith False cmdparser
(\a -> inRepo $ a . Just)
(liftIO . O.handleParseResult)
when (cmdnomessages cmd) $ do
Annex.setOutput QuietOutput
Annex.changeState $ \s -> s
{ Annex.output = (Annex.output s) { implicitMessages = False } }
getParsed globalconfig
whenM (annexDebug <$> Annex.getGitConfig) $
liftIO enableDebugOutput
prepRunCommand cmd globalconfig
startup
performCommandAction cmd seek $
shutdown $ cmdnocommit cmd
@ -123,3 +119,13 @@ findCmd fuzzyok argv cmds
inexactcmds = case name of
Nothing -> []
Just n -> Git.AutoCorrect.fuzzymatches n cmdname cmds
prepRunCommand :: Command -> GlobalSetter -> Annex ()
prepRunCommand cmd globalconfig = do
when (cmdnomessages cmd) $ do
Annex.setOutput QuietOutput
Annex.changeState $ \s -> s
{ Annex.output = (Annex.output s) { implicitMessages = False } }
getParsed globalconfig
whenM (annexDebug <$> Annex.getGitConfig) $
liftIO enableDebugOutput