From: keni Date: Wed, 22 Jun 2016 23:28:23 +0000 (-0400) Subject: add docs for the cmdhelp conditionals X-Git-Tag: NetHack-3.6.1_RC01~657 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ce26d2616d63d8c0e75164f0ed4f8200ec0b8a3a;p=nethack add docs for the cmdhelp conditionals --- diff --git a/src/pager.c b/src/pager.c index 661cf04a5..b00c425a9 100644 --- a/src/pager.c +++ b/src/pager.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 pager.c $NHDT-Date: 1465114189 2016/06/05 08:09:49 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.107 $ */ +/* NetHack 3.6 pager.c $NHDT-Date: 1466638086 2016/06/22 23:28:06 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.111 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1307,6 +1307,35 @@ doidtrap() return 0; } +/* + Implements a rudimentary if/elif/else/endif interpretor and use + conditionals in dat/cmdhelp to describe what command each keystroke + currently invokes, so that there isn't a lot of "(debug mode only)" + and "(if number_pad is off)" cluttering the feedback that the user + sees. (The conditionals add quite a bit of clutter to the raw data + but users don't see that. number_pad produces a lot of conditional + commands: basic letters vs digits, 'g' vs 'G' for '5', phone + keypad vs normal layout of digits, and QWERTZ keyboard swap between + y/Y/^Y/M-y/M-Y/M-^Y and z/Z/^Z/M-z/M-Z/M-^Z.) + + The interpretor understands + '&#' for comment, + '&? option' for 'if' (also '&? !option' + or '&? option=value[,value2,...]' + or '&? !option=value[,value2,...]'), + '&: option' for 'elif' (with argument variations same as 'if'; + any number of instances for each 'if'), + '&:' for 'else' (also '&: #comment'; + 0 or 1 instance for a given 'if'), and + '&.' for 'endif' (also '&. #comment'; required for each 'if'). + + The option handling is a bit of a mess, with no generality for + which options to deal with and only a comma separated list of + integer values for the '=value' part. number_pad is the only + supported option that has a value; the few others (wizard/debug, + rest_on_space, #if SHELL, #if SUSPEND) are booleans. +*/ + STATIC_DCL void whatdoes_help() {