api: show program name in --version output, like other tools

[ci skip]
This commit is contained in:
Simon Michael 2017-07-17 17:39:23 +01:00
parent 7d7c932a2d
commit 8fb0b6886c

View File

@ -74,7 +74,7 @@ main :: IO ()
main = do
args <- getArgs >>= parseArgsOrExit doc
when (isPresent args (shortOption 'h') || isPresent args (longOption "help")) $ exitWithUsage doc
when (isPresent args (longOption "version")) $ putStrLn hledgerApiVersion >> exitSuccess
when (isPresent args (longOption "version")) $ putStrLn ("hledger-api " ++ hledgerApiVersion) >> exitSuccess
when (isPresent args (longOption "swagger")) $ BL8.putStrLn (encode swaggerSpec) >> exitSuccess
let
defh = "127.0.0.1"