From d854f16486913af7fb70e4ff251a29d5cf2d7323 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sun, 17 Jul 2016 18:24:12 +0300 Subject: refactoring --- apps/UnsetEnv.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'apps/UnsetEnv.hs') 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 () -- cgit v1.2.3