module Git.Stale.Types.Env
( BranchType (..),
Env (..),
branchTypeToArg,
)
where
import Common.RefinedUtils
import qualified Data.Text as T
import qualified Data.Time.Calendar as C
import qualified System.IO as IO
data BranchType
= All
| Remote
| Local
deriving (BranchType -> BranchType -> Bool
(BranchType -> BranchType -> Bool)
-> (BranchType -> BranchType -> Bool) -> Eq BranchType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BranchType -> BranchType -> Bool
$c/= :: BranchType -> BranchType -> Bool
== :: BranchType -> BranchType -> Bool
$c== :: BranchType -> BranchType -> Bool
Eq, Int -> BranchType -> ShowS
[BranchType] -> ShowS
BranchType -> String
(Int -> BranchType -> ShowS)
-> (BranchType -> String)
-> ([BranchType] -> ShowS)
-> Show BranchType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BranchType] -> ShowS
$cshowList :: [BranchType] -> ShowS
show :: BranchType -> String
$cshow :: BranchType -> String
showsPrec :: Int -> BranchType -> ShowS
$cshowsPrec :: Int -> BranchType -> ShowS
Show)
branchTypeToArg :: BranchType -> String
branchTypeToArg :: BranchType -> String
branchTypeToArg All = "-a"
branchTypeToArg Remote = "-r"
branchTypeToArg Local = ""
data Env
= Env
{
Env -> Maybe Text
grepStr :: Maybe T.Text,
Env -> Maybe String
path :: Maybe IO.FilePath,
Env -> RNonNegative Int
limit :: RNonNegative Int,
Env -> BranchType
branchType :: BranchType,
Env -> Text
remoteName :: T.Text,
Env -> Text
master :: T.Text,
Env -> Day
today :: C.Day
}
deriving (Int -> Env -> ShowS
[Env] -> ShowS
Env -> String
(Int -> Env -> ShowS)
-> (Env -> String) -> ([Env] -> ShowS) -> Show Env
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Env] -> ShowS
$cshowList :: [Env] -> ShowS
show :: Env -> String
$cshow :: Env -> String
showsPrec :: Int -> Env -> ShowS
$cshowsPrec :: Int -> Env -> ShowS
Show)