Hish-0.1.1.0

Safe HaskellNone
LanguageHaskell2010

Hish.SysInfo

Contents

Synopsis

Basic information

name

uid :: IO (Maybe String) Source

return username

hostname :: IO (Maybe String) Source

return hostname

working directory

pwd Source

Arguments

:: Int

threshold of shortening

-> IO (Maybe String) 

return current working directory

time and date

time Source

Arguments

:: String

format (read Data.Time.Format for more detail)

-> IO String 

return time or date for given format

>>> time "%H:%M"
13:15
>>> time "%Y-%b-%d"
2015-Oct-20

date :: String -> IO String Source

just an alias of time

version control system

status Source

Arguments

:: VCS a 
=> a

version control system

-> IO (Maybe String, Maybe String, Maybe String)

(cleanliness, ahead, behind)

get current status.

branch Source

Arguments

:: VCS a 
=> a

version control system

-> IO (Maybe String)

current branch name

get current name of git-branch

Primitive functions

simpleCmd Source

Arguments

:: (String -> Maybe String)

translate raw text to information

-> String

console command

-> IO (Maybe String) 

execute command with text handler but without args

argedCmd Source

Arguments

:: (String -> Maybe String)

translate raw text to information

-> String

console command

-> [String]

command arguments

-> IO (Maybe String) 

execute command with text handler and args