improve global options display in --help
Put them in the help of subcommands, not the main command. And, hide them from the synopsis, to avoid cluttering it.
This commit is contained in:
parent
b66a2d6c5b
commit
7af0893abd
6 changed files with 50 additions and 17 deletions
24
CmdLine/GlobalSetter.hs
Normal file
24
CmdLine/GlobalSetter.hs
Normal file
|
@ -0,0 +1,24 @@
|
|||
{- git-annex global options
|
||||
-
|
||||
- Copyright 2015 Joey Hess <id@joeyh.name>
|
||||
-
|
||||
- Licensed under the GNU GPL version 3 or higher.
|
||||
-}
|
||||
|
||||
module CmdLine.GlobalSetter where
|
||||
|
||||
import Types.DeferredParse
|
||||
import Common
|
||||
import Annex
|
||||
|
||||
import Options.Applicative
|
||||
|
||||
globalFlag :: Annex () -> Mod FlagFields GlobalSetter -> Parser GlobalSetter
|
||||
globalFlag setter = flag' (DeferredParse setter)
|
||||
|
||||
globalSetter :: (v -> Annex ()) -> Parser v -> Parser GlobalSetter
|
||||
globalSetter setter parser = DeferredParse . setter <$> parser
|
||||
|
||||
combineGlobalSetters :: [Parser GlobalSetter] -> Parser GlobalSetter
|
||||
combineGlobalSetters l = DeferredParse . sequence_ . map getParsed
|
||||
<$> many (foldl1 (<|>) l)
|
Loading…
Add table
Add a link
Reference in a new issue