From 1663ecf85dc8fadf539f2761c24b33255e685759 Mon Sep 17 00:00:00 2001 From: nhkeni Date: Thu, 3 Aug 2023 21:51:25 -0400 Subject: [PATCH] Add --version:copy, deprecate --version:paste. --- dat/usagehlp | 6 +++--- doc/nethack.6 | 6 +++--- src/allmain.c | 8 ++++++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/dat/usagehlp b/dat/usagehlp index 27b0c431f..154285534 100644 --- a/dat/usagehlp +++ b/dat/usagehlp @@ -111,11 +111,11 @@ nethack --directory:Dir -s as above; alternate directory, if specified, should come first. nethack --version -nethack --version:paste +nethack --version:copy '--version' display the program's version number and exit; - '--version:paste' display version number and also copy it into system + '--version:copy' display version number and also copy it into system pasteboard (should work on macOS and Windows; might not work on other - systems) so that it could be copied from there into a subsequent email + systems) so that it could be pasted from there into a subsequent email or web contact form, then exit. nethack --showpaths diff --git a/doc/nethack.6 b/doc/nethack.6 index 3bbfa605b..2a9329390 100644 --- a/doc/nethack.6 +++ b/doc/nethack.6 @@ -9,7 +9,7 @@ .ds Nr \\$2 .. .NB $NHDT-Branch: NetHack-3.7 $ -.NR $NHDT-Revision: 1.27 $ +.NR $NHDT-Revision: 1.31 $ .ds Na Robert Patrick Rankin .SH NAME nethack \- Exploring The Mazes of Menace @@ -124,7 +124,7 @@ Also .BR \-\-showpaths ] [ -.BR \-\-version [ :paste ] +.BR \-\-version [ :copy ] ] .ad .hy 14 @@ -374,7 +374,7 @@ That will include the .I git commit hash if the information was available when the game was compiled. On some platforms, such as Windows and macOS, a variation -.B \-\-version:paste +.B \-\-version:copy can be used to cause NetHack to show the version information, then exit, while also leaving a copy of the version information in the paste buffer or clipboard for potential insertion into things like bug reports. diff --git a/src/allmain.c b/src/allmain.c index ad2896654..e0066c480 100644 --- a/src/allmain.c +++ b/src/allmain.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 allmain.c $NHDT-Date: 1688415115 2023/07/03 20:11:55 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.219 $ */ +/* NetHack 3.7 allmain.c $NHDT-Date: 1691113621 2023/08/04 01:47:01 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.220 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2012. */ /* NetHack may be freely redistributed. See license for details. */ @@ -966,11 +966,15 @@ argcheck(int argc, char *argv[], enum earlyarg e_arg) if (extended_opt) { extended_opt++; + /* Deprecated in favor of "copy" - remove no later + than next major version */ if (match_optname(extended_opt, "paste", 5, FALSE)) { insert_into_pastebuf = TRUE; + } else if(match_optname(extended_opt, "copy", 4, FALSE)) { + insert_into_pastebuf = TRUE; } else { raw_printf( - "-%sversion can only be extended with -%sversion:paste.\n", + "-%sversion can only be extended with -%sversion:copy.\n", dashdash, dashdash); return TRUE; }