module Agda.Interaction.Options.Help
(
Help (..)
, helpTopicUsage
, string2HelpTopic
, allHelpTopics
) where
import Agda.Interaction.Options.Warnings
data Help
= GeneralHelp
| HelpFor HelpTopic
deriving (Help -> Help -> Bool
(Help -> Help -> Bool) -> (Help -> Help -> Bool) -> Eq Help
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Help -> Help -> Bool
$c/= :: Help -> Help -> Bool
== :: Help -> Help -> Bool
$c== :: Help -> Help -> Bool
Eq, Int -> Help -> ShowS
[Help] -> ShowS
Help -> String
(Int -> Help -> ShowS)
-> (Help -> String) -> ([Help] -> ShowS) -> Show Help
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Help] -> ShowS
$cshowList :: [Help] -> ShowS
show :: Help -> String
$cshow :: Help -> String
showsPrec :: Int -> Help -> ShowS
$cshowsPrec :: Int -> Help -> ShowS
Show)
data HelpTopic
= Warning
deriving (HelpTopic -> HelpTopic -> Bool
(HelpTopic -> HelpTopic -> Bool)
-> (HelpTopic -> HelpTopic -> Bool) -> Eq HelpTopic
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HelpTopic -> HelpTopic -> Bool
$c/= :: HelpTopic -> HelpTopic -> Bool
== :: HelpTopic -> HelpTopic -> Bool
$c== :: HelpTopic -> HelpTopic -> Bool
Eq, Int -> HelpTopic -> ShowS
[HelpTopic] -> ShowS
HelpTopic -> String
(Int -> HelpTopic -> ShowS)
-> (HelpTopic -> String)
-> ([HelpTopic] -> ShowS)
-> Show HelpTopic
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HelpTopic] -> ShowS
$cshowList :: [HelpTopic] -> ShowS
show :: HelpTopic -> String
$cshow :: HelpTopic -> String
showsPrec :: Int -> HelpTopic -> ShowS
$cshowsPrec :: Int -> HelpTopic -> ShowS
Show)
allHelpTopics :: [(String, HelpTopic)]
allHelpTopics :: [(String, HelpTopic)]
allHelpTopics = [(String
"warning", HelpTopic
Warning)]
helpTopicUsage :: HelpTopic -> String
helpTopicUsage :: HelpTopic -> String
helpTopicUsage HelpTopic
tp = case HelpTopic
tp of
HelpTopic
Warning -> String
usageWarning
string2HelpTopic :: String -> Maybe HelpTopic
string2HelpTopic :: String -> Maybe HelpTopic
string2HelpTopic String
str = String -> [(String, HelpTopic)] -> Maybe HelpTopic
forall a b. Eq a => a -> [(a, b)] -> Maybe b
lookup String
str [(String, HelpTopic)]
allHelpTopics