diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2016-11-10 15:18:30 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2016-11-10 15:18:30 +0300 |
commit | 0d8b7efe4d74aa59513790da795ac4fde21be79b (patch) | |
tree | 8a60217b6b8ac2c23e90dcb71df457c03d3c5acd /apps/PromptMessage.hs | |
parent | README update (diff) | |
download | windows-env-0d8b7efe4d74aa59513790da795ac4fde21be79b.tar.gz windows-env-0d8b7efe4d74aa59513790da795ac4fde21be79b.zip |
safer registry access routines
+ use patched Win32.
Diffstat (limited to '')
-rw-r--r-- | apps/PromptMessage.hs | 13 |
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 |