move global options handling closer to Command definitions

This commit is contained in:
Joey Hess 2021-02-02 15:55:45 -04:00
parent 4cc65d97fc
commit e78d2c9642
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 20 additions and 15 deletions

View file

@ -12,7 +12,6 @@ import Types.Benchmark
import Types.Command
import CmdLine.Action
import CmdLine
import CmdLine.GitAnnex.Options
import qualified Annex
import qualified Annex.Branch
@ -39,7 +38,7 @@ mkGenerator cmds userinput = do
-- matching or out-of-repo commands.
parsesubcommand ps = do
(cmd, seek, globalconfig) <- liftIO $ O.handleParseResult $
parseCmd "git-annex" "benchmarking" gitAnnexGlobalOptions ps cmds cmdparser
parseCmd "git-annex" "benchmarking" ps cmds cmdparser
-- Make an entirely separate Annex state for each subcommand,
-- and prepare it to run the cmd.
st <- liftIO . Annex.new =<< Annex.getState Annex.repo