From 8653780e04df0ad0d24b5be15a98bb0dcb01ca30 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sun, 17 Jul 2016 15:47:51 +0300 Subject: add command line options to skip prompts --- apps/ListPath.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'apps/ListPath.hs') diff --git a/apps/ListPath.hs b/apps/ListPath.hs index 469fbba..e0cbefe 100644 --- a/apps/ListPath.hs +++ b/apps/ListPath.hs @@ -24,7 +24,7 @@ options = Options <$> optNameDesc where optNameDesc = strOption $ long "name" <> short 'n' <> metavar "NAME" <> value "PATH" <> - help "Specify variable name ('PATH' by default)" + help "Variable name ('PATH' by default)" main :: IO () main = execParser parser >>= listPath @@ -40,6 +40,7 @@ listPath options = do where varName = optName options getEnv = liftM (fromMaybe "") . lookupEnv + printPath p = do exists <- doesDirectoryExist p putStrLn $ (if exists then "+" else "-") ++ " " ++ p -- cgit v1.2.3