diff options
Diffstat (limited to 'Utility/UserInfo.hs')
-rw-r--r-- | Utility/UserInfo.hs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Utility/UserInfo.hs b/Utility/UserInfo.hs index bdddf4f8e..8fba3e17f 100644 --- a/Utility/UserInfo.hs +++ b/Utility/UserInfo.hs @@ -7,7 +7,8 @@ module Utility.UserInfo ( myHomeDir, - myUserName + myUserName, + myUserGecos, ) where import Control.Applicative @@ -24,6 +25,9 @@ myHomeDir = myVal ["HOME"] homeDirectory myUserName :: IO String myUserName = myVal ["USER", "LOGNAME"] userName +myUserGecos :: IO String +myUserGecos = myVal [] userGecos + myVal :: [String] -> (UserEntry -> String) -> IO String myVal envvars extract = maybe (extract <$> getpwent) return =<< check envvars where |