aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/apps/PromptMessage.hs
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2016-11-10 15:18:30 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2016-11-10 15:18:30 +0300
commit0d8b7efe4d74aa59513790da795ac4fde21be79b (patch)
tree8a60217b6b8ac2c23e90dcb71df457c03d3c5acd /apps/PromptMessage.hs
parentREADME update (diff)
downloadwindows-env-0d8b7efe4d74aa59513790da795ac4fde21be79b.tar.gz
windows-env-0d8b7efe4d74aa59513790da795ac4fde21be79b.zip
safer registry access routines
+ use patched Win32.
Diffstat (limited to '')
-rw-r--r--apps/PromptMessage.hs13
1 files changed, 5 insertions, 8 deletions
diff --git a/apps/PromptMessage.hs b/apps/PromptMessage.hs
index b02c0a2..27851cf 100644
--- a/apps/PromptMessage.hs
+++ b/apps/PromptMessage.hs
@@ -9,26 +9,23 @@ module PromptMessage
, wipeMessage
) where
-import Data.Maybe (isJust)
import Text.Printf (printf)
import qualified Windows.Environment as Env
-engraveMessage :: Env.Profile -> Env.VarName -> Maybe Env.VarValue -> Env.VarValue -> String
+engraveMessage :: Env.Profile -> Env.VarName -> Env.VarValue -> Env.VarValue -> String
engraveMessage profile name oldValue newValue =
descriptionMsg ++ oldValueMsg ++ newValueMsg
where
profileKey = Env.profileKeyPath profile
- descriptionMsg = printf "Saving variable '%s' to '%s'...\n" name profileKey
+ descriptionMsg = printf "Saving variable '%s' to '%s'...\n" name (show profileKey)
- oldValueMsg = maybe "" (printf "\tOld value: %s\n") oldValue
- newValueMsg
- | isJust oldValue = printf "\tNew value: %s\n" newValue
- | otherwise = printf "\tValue: %s\n" newValue
+ oldValueMsg = printf "\tOld value: %s\n" oldValue
+ newValueMsg = printf "\tNew value: %s\n" newValue
wipeMessage :: Env.Profile -> Env.VarName -> String
wipeMessage profile name =
- printf "Deleting variable '%s' from '%s'...\n" name profileKey
+ printf "Deleting variable '%s' from '%s'...\n" name (show profileKey)
where
profileKey = Env.profileKeyPath profile