about summary refs log tree commit diff
path: root/users/grfn/xanthous/src/Xanthous/Command.hs
diff options
context:
space:
mode:
authorGriffin Smith <grfn@gws.fyi>2022-04-10T16·06-0400
committerclbot <clbot@tvl.fyi>2022-04-14T14·22+0000
commit3c294fbabd6622b8cd60984d7ed0dd811e8885eb (patch)
treef87e8f3afc9e32b5255d5919df9405aef3852163 /users/grfn/xanthous/src/Xanthous/Command.hs
parent79aceaec17b469dc6533470ea6c807f23eb7fe3e (diff)
feat(grfn/xanthous): Add a help panel r/3945
Change-Id: I581a37df0a20fa54878da4446007dbe677e057da
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5444
Autosubmit: grfn <grfn@gws.fyi>
Reviewed-by: grfn <grfn@gws.fyi>
Tested-by: BuildkiteCI
Diffstat (limited to 'users/grfn/xanthous/src/Xanthous/Command.hs')
-rw-r--r--users/grfn/xanthous/src/Xanthous/Command.hs16
1 files changed, 15 insertions, 1 deletions
diff --git a/users/grfn/xanthous/src/Xanthous/Command.hs b/users/grfn/xanthous/src/Xanthous/Command.hs
index 30ed86ee4041..6e6274a02c6f 100644
--- a/users/grfn/xanthous/src/Xanthous/Command.hs
+++ b/users/grfn/xanthous/src/Xanthous/Command.hs
@@ -1,7 +1,10 @@
 {-# LANGUAGE TemplateHaskell #-}
 --------------------------------------------------------------------------------
 module Xanthous.Command
-  ( Command(..)
+  ( -- * Commands
+    Command(..)
+  , commandIsHidden
+    -- * Keybindings
   , Keybinding(..)
   , keybindings
   , commands
@@ -29,6 +32,7 @@ import           Xanthous.Util.QuickCheck (GenericArbitrary(..))
 
 data Command
   = Quit
+  | Help
   | Move !Direction
   | StartAutoMove !Direction
   | PreviousMessage
@@ -58,6 +62,16 @@ data Command
        via WithOptions '[ SumEnc UntaggedVal ]
            Command
 
+-- | Should the command be hidden from the help menu?
+--
+-- Note that this is true for both debug commands and movement commands, as the
+-- latter is documented non-automatically
+commandIsHidden :: Command -> Bool
+commandIsHidden (Move _) = True
+commandIsHidden (StartAutoMove _) = True
+commandIsHidden ToggleRevealAll = True
+commandIsHidden _ = False
+
 --------------------------------------------------------------------------------
 
 data Keybinding = Keybinding !Key ![Modifier]