implement withGlobalOptions, and convert Find

This commit is contained in:
Joey Hess 2015-07-10 12:47:35 -04:00
parent 7af0893abd
commit 5cc882a35e
6 changed files with 44 additions and 24 deletions

View file

@ -56,7 +56,7 @@ import qualified Command.AddUnused
import qualified Command.Unlock
import qualified Command.Lock
import qualified Command.PreCommit
--import qualified Command.Find
import qualified Command.Find
--import qualified Command.FindRef
--import qualified Command.Whereis
--import qualified Command.List
@ -183,7 +183,7 @@ cmds =
-- , Command.Unused.cmd
-- , Command.DropUnused.cmd
, Command.AddUnused.cmd
-- , Command.Find.cmd
, Command.Find.cmd
-- , Command.FindRef.cmd
-- , Command.Whereis.cmd
-- , Command.List.cmd

View file

@ -200,8 +200,8 @@ fileMatchingOptions' =
"match files smaller than a size"
]
parseCombiningOptions :: Parser [GlobalSetter]
parseCombiningOptions =
combiningOptions :: Parser [GlobalSetter]
combiningOptions =
many $ longopt "not" "negate next option"
<|> longopt "and" "both previous and next option must match"
<|> longopt "or" "either previous or next option must match"
@ -211,8 +211,8 @@ parseCombiningOptions =
longopt o h = globalFlag (Limit.addToken o) ( long o <> help h )
shortopt o h = globalFlag (Limit.addToken [o]) ( short o <> help h)
parseJsonOption :: Parser GlobalSetter
parseJsonOption = globalFlag (Annex.setOutput JSONOutput)
jsonOption :: Parser GlobalSetter
jsonOption = globalFlag (Annex.setOutput JSONOutput)
( long "json" <> short 'j'
<> help "enable JSON output"
)