diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2016-07-17 15:47:51 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2016-07-17 15:47:51 +0300 |
commit | 8653780e04df0ad0d24b5be15a98bb0dcb01ca30 (patch) | |
tree | 8137ce258398a6c422dc36b8751ffe4f1fc05364 /apps/ListPath.hs | |
parent | README update (diff) | |
download | windows-env-8653780e04df0ad0d24b5be15a98bb0dcb01ca30.tar.gz windows-env-8653780e04df0ad0d24b5be15a98bb0dcb01ca30.zip |
add command line options to skip prompts
Diffstat (limited to '')
-rw-r--r-- | apps/ListPath.hs | 3 |
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 |