Hish-0.1.0

Safe HaskellNone
LanguageHaskell2010

Hish.SysInfo

Contents

Synopsis

Get basic information

uid :: IO (Maybe String) Source

return username

hostname :: IO (Maybe String) Source

return hostname

pwd Source

Arguments

:: Int

threshold of shortening

-> IO (Maybe String) 

return current working directory

shortDir Source

Arguments

:: [String]

a list of folder name

-> String 

concating the given list of name into a path. Notice that, this function will NOT add root, /, or home, ~, to the leftmost position. For example,

>>> pwdShorten ["A","B","C"]
"A/B/C"

Get VCS-related information

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