'nethack --usage' and '?' menu
Write up a description of how the command line works on UNIX and put that in new file dat/usagehlp. Add support for |nethack --usage | --help | -? | ? to display it and exit. Also add a menu entry for nethack's help command to show it during play. That can be suppressed by uncommenting new '#define HIDE_USAGE' in config.h since it won't be useful on servers that don't give players access to command lines. New genl_display_file() just writes to stdout. opt_usage(), which calls it, might need some suid/sgid handling to make sure the output is done as the player rather than as nethack. doc/nethack.6 is already out of date again.
This commit is contained in:
@@ -421,6 +421,15 @@
|
||||
*/
|
||||
#endif /* CHDIR */
|
||||
|
||||
/*
|
||||
* Define HIDE_USAGE to keep the "description of command line" out of
|
||||
* the help menu if players have no access to a command line or if that
|
||||
* is radically different from the description for UNIX in dat/usagehlp
|
||||
* (a better solution for that would be a separate file and different
|
||||
* value for USAGEHELP in global.h).
|
||||
*/
|
||||
/* #define HIDE_USAGE */ /* */
|
||||
|
||||
/*
|
||||
* Section 3: Definitions that may vary with system type.
|
||||
* For example, both schar and uchar should be short ints on
|
||||
|
||||
@@ -3303,6 +3303,7 @@ extern char *encglyph(int);
|
||||
extern int decode_glyph(const char *str, int *glyph_ptr);
|
||||
extern char *decode_mixed(char *, const char *);
|
||||
extern void genl_putmixed(winid, int, const char *);
|
||||
extern void genl_display_file(const char *, boolean);
|
||||
extern boolean menuitem_invert_test(int, unsigned, boolean);
|
||||
|
||||
/* ### windows.c ### */
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#define LICENSE "license" /* file with license information */
|
||||
#define OPTIONFILE "opthelp" /* file explaining runtime options */
|
||||
#define OPTMENUHELP "optmenu" /* file explaining #options command */
|
||||
#define USAGEHELP "usagehlp" /* file explaining command line use */
|
||||
#define OPTIONS_USED "options" /* compile-time options, for #version */
|
||||
#define SYMBOLS "symbols" /* replacement symbol sets */
|
||||
#define EPITAPHFILE "epitaph" /* random epitaphs on graves */
|
||||
|
||||
Reference in New Issue
Block a user