about summary refs log tree commit diff
path: root/users/grfn/xanthous/src/Xanthous/Command.hs
diff options
context:
space:
mode:
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]