+data Command = Command {
+ name :: Text,
+ description :: Text,
+ dispatch :: ExceptT Text IO Text
+ }
+
+commands :: [Command]
+commands = [
+ Command "init" "Initialise a new site" $ init getLocalProjectConfig getGlobalProjectConfig,
+ Command "build" "Build the site" $ resolveProjectConfig >>= build,
+ Command "entry" "Initialise an entry" $ resolveProjectConfig >>= entry,
+ Command "config" "Show project configuration" $ resolveProjectConfig >>= config
+ ]
+
+usage :: [Command] -> ExceptT Text IO Text
+usage c = pure . ununlines $ [