From b24d1456d03e86407c66ca623f79072ff54de362 Mon Sep 17 00:00:00 2001 From: Ian Jeffries Date: Fri, 22 Mar 2019 19:04:01 -0400 Subject: Default --package to '.' (#27) --- app/Indexer.hs | 4 +++- app/Server.hs | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/Indexer.hs b/app/Indexer.hs index 9560fad..7fc560e 100644 --- a/app/Indexer.hs +++ b/app/Indexer.hs @@ -39,7 +39,9 @@ import Options.Applicative , optional , progDesc , short + , showDefault , strOption + , value ) import Paths_haskell_code_explorer as HSE (version) import System.Directory (createDirectoryIfMissing) @@ -160,7 +162,7 @@ configParser :: Parser IndexerConfig configParser = IndexerConfig <$> strOption - (long "package" <> short 'p' <> metavar "PATH" <> + (long "package" <> short 'p' <> metavar "PATH" <> value "." <> showDefault <> help "Path to a Cabal package") <*> optional (strOption diff --git a/app/Server.hs b/app/Server.hs index 353f808..2304f27 100644 --- a/app/Server.hs +++ b/app/Server.hs @@ -206,7 +206,8 @@ configParser = some (strOption (long "package" <> short 'p' <> metavar "PATH" <> - help "Path to a Cabal package"))) <*> + help "Path to a Cabal package (Default: '.')")) + <|> pure (Directories ["."])) <*> (pure 8080 <|> option auto -- cgit v1.2.3