[client] Add key bindings to help text
This commit is contained in:
parent
e6958e11cb
commit
6359555db6
1 changed files with 24 additions and 1 deletions
|
|
@ -3,7 +3,9 @@ module Forest.Client.Options
|
||||||
, clientOptionsParserInfo
|
, clientOptionsParserInfo
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import Data.List
|
||||||
import Options.Applicative
|
import Options.Applicative
|
||||||
|
import Options.Applicative.Help.Pretty
|
||||||
|
|
||||||
data ClientOptions = ClientOptions
|
data ClientOptions = ClientOptions
|
||||||
{ clientHostName :: String
|
{ clientHostName :: String
|
||||||
|
|
@ -40,5 +42,26 @@ parser = ClientOptions
|
||||||
<> help "This flag disables ssl on outgoing websocket connections"
|
<> help "This flag disables ssl on outgoing websocket connections"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
keyBindings :: String
|
||||||
|
keyBindings = intercalate "\n"
|
||||||
|
[ "Key bindings:"
|
||||||
|
, " exit q, esc"
|
||||||
|
, " move cursor up/down, j/k"
|
||||||
|
, " toggle fold tab"
|
||||||
|
, " edit node e"
|
||||||
|
, " delete node d"
|
||||||
|
, " new child (reply) r"
|
||||||
|
, " new sibling R"
|
||||||
|
, " perform action a, enter, space"
|
||||||
|
, ""
|
||||||
|
, "Editor key bindings:"
|
||||||
|
, " confirm edit enter"
|
||||||
|
, " abort edit esc"
|
||||||
|
, " insert newline ctrl+n"
|
||||||
|
]
|
||||||
|
|
||||||
clientOptionsParserInfo :: ParserInfo ClientOptions
|
clientOptionsParserInfo :: ParserInfo ClientOptions
|
||||||
clientOptionsParserInfo = info (helper <*> parser) mempty
|
clientOptionsParserInfo = info (helper <*> parser)
|
||||||
|
( fullDesc
|
||||||
|
<> footerDoc (Just $ string keyBindings)
|
||||||
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue