aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/apps/ListPath.hs
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2016-07-17 15:47:51 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2016-07-17 15:47:51 +0300
commit8653780e04df0ad0d24b5be15a98bb0dcb01ca30 (patch)
tree8137ce258398a6c422dc36b8751ffe4f1fc05364 /apps/ListPath.hs
parentREADME update (diff)
downloadwindows-env-8653780e04df0ad0d24b5be15a98bb0dcb01ca30.tar.gz
windows-env-8653780e04df0ad0d24b5be15a98bb0dcb01ca30.zip
add command line options to skip prompts
Diffstat (limited to 'apps/ListPath.hs')
-rw-r--r--apps/ListPath.hs3
1 files changed, 2 insertions, 1 deletions
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