aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/app/ListPaths.hs
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2017-06-11 05:56:10 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2017-06-11 05:56:10 +0300
commit837e60b9d8826168896ad4155ff7046f00665f52 (patch)
tree18c40efee9f38954079119587d3b60ababf5e555 /app/ListPaths.hs
parentdelenv: ignore missing variables (diff)
downloadwindows-env-837e60b9d8826168896ad4155ff7046f00665f52.tar.gz
windows-env-837e60b9d8826168896ad4155ff7046f00665f52.zip
WindowsEnv: {VarName,VarValue} -> {Name,Value}
Also, fix compiler warnings (I've got too used to building with `--ghc-options -w`).
Diffstat (limited to '')
-rw-r--r--app/ListPaths.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/ListPaths.hs b/app/ListPaths.hs
index f832686..c507d39 100644
--- a/app/ListPaths.hs
+++ b/app/ListPaths.hs
@@ -30,7 +30,7 @@ data Source = Environment | Registry WindowsEnv.Profile
deriving (Eq, Show)
data Options = Options
- { optName :: WindowsEnv.VarName
+ { optName :: WindowsEnv.Name
, optWhichPaths :: WhichPaths
, optSource :: Source
} deriving (Eq, Show)
@@ -70,12 +70,12 @@ listPaths options = runExceptT doListPaths >>= either ioError return
query = queryFrom $ optSource options
- queryFrom Environment = lift $ WindowsEnv.VarValue False <$> fromMaybe "" <$> lookupEnv varName
+ queryFrom Environment = lift $ WindowsEnv.Value False <$> fromMaybe "" <$> lookupEnv varName
queryFrom (Registry profile) = WindowsEnv.query profile varName
doListPaths = do
- value <- query
- split <- WindowsEnv.pathSplitAndExpand value
+ varValue <- query
+ split <- WindowsEnv.pathSplitAndExpand varValue
lift $ do
wanted <- filterM (shouldListPath whichPaths) split
mapM_ (putStrLn . WindowsEnv.pathOriginal) wanted