aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/apps/UnsetEnv.hs
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2016-07-17 18:24:12 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2016-07-17 18:24:12 +0300
commitd854f16486913af7fb70e4ff251a29d5cf2d7323 (patch)
treecffae3dc6f90ff96da9b11ddc57d7bf43bc97ad1 /apps/UnsetEnv.hs
parentupdate project description (diff)
downloadwindows-env-d854f16486913af7fb70e4ff251a29d5cf2d7323.tar.gz
windows-env-d854f16486913af7fb70e4ff251a29d5cf2d7323.zip
refactoring
Diffstat (limited to 'apps/UnsetEnv.hs')
-rw-r--r--apps/UnsetEnv.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/UnsetEnv.hs b/apps/UnsetEnv.hs
index 14111d2..6f47473 100644
--- a/apps/UnsetEnv.hs
+++ b/apps/UnsetEnv.hs
@@ -39,7 +39,7 @@ main = execParser parser >>= unsetEnv
fullDesc <> progDesc "Unset environment variable"
unsetEnv :: Options -> IO ()
-unsetEnv options = wipe env varName
+unsetEnv options = wipe
where
varName = optName options
@@ -48,6 +48,6 @@ unsetEnv options = wipe env varName
| otherwise = Environment.CurrentUser
skipPrompt = optYes options
- wipe
- | skipPrompt = Environment.wipe
- | otherwise = Environment.wipeWithPrompt
+ wipe = if skipPrompt
+ then Environment.wipe env varName
+ else Environment.wipePrompt env varName >> return ()