diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2016-07-18 00:43:21 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2016-07-18 00:43:21 +0300 |
commit | be9299d2dc8e0a9e76fe6f07cabb15c144999710 (patch) | |
tree | 91a68cd35e78c612eb358181f24e91fda904e766 /apps/Utils.hs | |
parent | put modules to 'Windows' (diff) | |
download | windows-env-be9299d2dc8e0a9e76fe6f07cabb15c144999710.tar.gz windows-env-be9299d2dc8e0a9e76fe6f07cabb15c144999710.zip |
refactoring
Diffstat (limited to '')
-rw-r--r-- | apps/Prompt.hs (renamed from apps/Utils.hs) | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/apps/Utils.hs b/apps/Prompt.hs index e34950f..97c23fa 100644 --- a/apps/Utils.hs +++ b/apps/Prompt.hs @@ -4,21 +4,14 @@ - See LICENSE.txt for details. -} -module Utils +module Prompt ( withPrompt , withoutPrompt - - , engraveBanner - , wipeBanner ) where import Control.Monad (liftM, void, when) -import Data.Maybe (fromJust, isJust) import Data.Char (toLower) import System.IO (hFlush, stdout) -import Text.Printf (printf) - -import Windows.Environment (Profile, profileKeyPath, VarName, VarValue) prompt :: String -> IO String prompt banner = do @@ -51,16 +44,3 @@ withPrompt banner m = do withoutPrompt :: IO a -> IO Bool withoutPrompt m = m >> return True - -engraveBanner :: Profile -> VarName -> Maybe VarValue -> VarValue -> String -engraveBanner profile name oldValue newValue = - header ++ values - where - header = printf "Saving variable '%s' to '%s'...\n" name (profileKeyPath profile) - values = if isJust oldValue - then printf "\tOld value: %s\n\tNew value: %s\n" (fromJust oldValue) newValue - else printf "\tValue: %s\n" newValue - -wipeBanner :: Profile -> VarName -> String -wipeBanner profile name = - printf "Deleting variable '%s' from '%s'...\n" name (profileKeyPath profile) |