convert version command, and make --raw work when not in a git repo

This commit is contained in:
Joey Hess 2015-07-10 13:49:46 -04:00
parent b4d22e6d49
commit 4064dd4c82
5 changed files with 51 additions and 51 deletions

View file

@ -12,7 +12,6 @@ module Command (
noRepo,
noCommit,
noMessages,
withOptions,
withGlobalOptions,
next,
stop,
@ -43,7 +42,7 @@ import qualified Options.Applicative as O
{- Generates a normal Command -}
command :: String -> CommandSection -> String -> CmdParamsDesc -> (CmdParamsDesc -> CommandParser) -> Command
command name section desc paramdesc mkparser =
Command [] commonChecks False False name paramdesc
Command commonChecks False False name paramdesc
section desc (mkparser paramdesc) Nothing
{- Simple option parser that takes all non-option params as-is. -}
@ -76,10 +75,6 @@ noMessages c = c { cmdnomessages = True }
noRepo :: (String -> O.Parser (IO ())) -> Command -> Command
noRepo a c = c { cmdnorepo = Just (a (cmdparamdesc c)) }
{- Adds options to a command. -}
withOptions :: [Option] -> Command -> Command
withOptions o c = c { cmdoptions = cmdoptions c ++ o }
{- Adds global options to a command's option parser, and modifies its seek
- option to first run actions for them.
-}