Skip to content

Commit c5a893e

Browse files
committed
checkpoint improve command line, man page, README.md
1 parent 029b34e commit c5a893e

4 files changed

Lines changed: 74 additions & 35 deletions

File tree

‎README.md‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ will cause `./rerun-rogo` to stop restarting rogomatic when `rogue(6)` exits.
4343
## IMPORTANT: Use with rogue 5.4.5
4444

4545
This rogomatic code is designed to be used with **rogue version
46-
5.4.5 release 2026-06-28**, or any later release of version 5.4.5.
46+
5.4.5 release 2026-06-30**, or any later release of version 5.4.5.
4747

4848
See [rogue version 5.4.5](https://github.com/lcn2/rogue5.4) for the
4949
latest version of rogue that is supported by rogomatic.
@@ -79,6 +79,12 @@ It is recommended that while `./rerun-rogo` is running, in another window run:
7979
./unstuck_player -v 1
8080
```
8181

82+
To view the top rogue scores generated by `./rerun-rogo`:
83+
84+
```sh
85+
rogue -s /var/tmp/rogo/rogue.scr
86+
```
87+
8288

8389
## unstuck_player
8490

@@ -237,7 +243,7 @@ The [rogomatic repo](https://github.com/lcn2/rogomatic) started out as a clone o
237243
[rogueforge rogomatic14 repo](https://github.com/rogueforge/rogomatic14).
238244

239245
**IMPORTANT NOTE**: This rogomatic code is designed to be used with **rogue version
240-
5.4.5 release 2026-06-28**, or any later release of version 5.4.5.
246+
5.4.5 release 2026-06-30**, or any later release of version 5.4.5.
241247

242248
See [rogue version 5.4.5](https://github.com/lcn2/rogue5.4) for the
243249
latest version of rogue that is supported by rogomatic.

‎SECURITY.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ additional information or guidance.
2929

3030
## Supported Versions
3131

32-
Only rogomatic version **14.1.14 2026-06-28** or later, when used with
33-
**rogue version 5.4.5 release 2026-06-28** or later, from the
32+
Only rogomatic version **14.1.14 2026-06-30** or later, when used with
33+
**rogue version 5.4.5 release 2026-06-30** or later, from the
3434
[rogue 5.4 repo](https://github.com/lcn2/rogue5.4) are supported.

‎rogomatic.6.in‎

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH ROGOMATIC 6 "2026 Mar 19"
1+
.TH ROGOMATIC 6 "2026 Mar 30"
22
.UC 4
33
.SH NAME
44
rogomatic, rgmgene, rgmhist, rgmscatter \- Automatically Exploring The Dungeons of Doom
@@ -23,20 +23,29 @@ rogomatic, rgmgene, rgmhist, rgmscatter \- Automatically Exploring The Dungeons
2323
.B \-e
2424
]
2525
[
26+
.B \-E
27+
]
28+
[
2629
.B \-f
2730
.I rogue
2831
]
2932
[
3033
.B \-H
3134
]
3235
[
33-
.BI \-p\ roguelog
36+
.B \-p
37+
]
38+
[
39+
.BI \-P\ player
3440
]
3541
[
3642
.B \-r
3743
]
3844
[
3945
.B \-s
46+
[
47+
.I rogue_ver
48+
]
4049
]
4150
[
4251
.BI \-S\ ROGOSEED
@@ -51,9 +60,6 @@ rogomatic, rgmgene, rgmhist, rgmscatter \- Automatically Exploring The Dungeons
5160
.B \-w
5261
]
5362
[
54-
.B \-E
55-
]
56-
[
5763
.I file
5864
]
5965
.SH DESCRIPTION
@@ -174,6 +180,9 @@ See also the
174180
.B e
175181
command in transparent mode.
176182
.TP
183+
.B \-E
184+
Start up in emacs mode.
185+
.TP
177186
.BI \-f \ rogue
178187
Set the path of
179188
.BR rogue .
@@ -213,7 +222,9 @@ has been tested with this version of
213222
.B rogomatic
214223
While other versions of rogue may work, only
215224
.B rogue version 5.4.5
216-
is now supported.
225+
with a minimum date of
226+
.BR 2026-06-30 ,
227+
is supported.
217228
.TP
218229
.B \-H
219230
Disable the so-called rogomatic "\fIhalftime show\fP".
@@ -237,7 +248,7 @@ however recently that option became the "help option",
237248
and so it was named as
238249
.BR \-H .
239250
.TP
240-
.BI \-p \ roguelog
251+
.B \-p
241252
Replay the
242253
.I roguelog
243254
rogue log file.
@@ -248,6 +259,9 @@ The default rogue log file is:
248259
.BI @RGMDIR@ /roguelog
249260
.in -0.5i
250261
.TP
262+
.BI \-P\ player
263+
Set the path to player.
264+
.TP
251265
.B \-r
252266
Restore a saved rogue game.
253267
.sp
@@ -270,11 +284,16 @@ command line option to
270284
the rogue game stored
271285
.IR file .
272286
.TP
273-
.B \-s
287+
.BR \-s\ [\ rogue_ver\ ]
274288
Print the
275289
.B rogomatic
276290
scoreboard.
277291
.sp
292+
The default
293+
.B rogue_ver
294+
is
295+
.BR 5.4.5 .
296+
.sp
278297
The default rogomatic scoreboard is:
279298
.sp
280299
.in +0.5i
@@ -319,9 +338,6 @@ starts exploring level 1.
319338
.TP
320339
.B \-w
321340
Start up in watched mode.
322-
.TP
323-
.B \-E
324-
Start up in emacs mode.
325341
.SH COMMANDS
326342
.PP
327343
The

‎setup.c‎

Lines changed: 37 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -47,31 +47,34 @@
4747
# define READ 0
4848
# define WRITE 1
4949

50-
# define VERSION "14.1.14 2026-06-28"
50+
# define VERSION "14.1.15 2026-06-30"
5151

5252
/*
5353
* static declarations
5454
*/
5555
static const char * const usage =
56-
"usage: %s [-h] [-V] [-c] [-e] [-f rogue] [-H] [-p] [-P player] [-r] [-s] [-S ROGOSEED] [-t] [-u] [-w] [-E]\n"
56+
"usage: %s [-h] [-V] [-c] [-d] [-D rgmdir] [-e] [-E] [-f rogue] [-H]\n"
57+
" [-p] [-P player] [-r] [-s [rogue_ver]] [-S ROGOSEED] [-t] [-u] [-w]\n"
5758
"\n"
5859
" -h print help message and exit\n"
5960
" -V print version string and exit\n"
6061
"\n"
6162
" -c use trap arrows\n"
6263
" -d use unique directory name\n"
64+
" -D rgmdir set rogomatic directory path\n"
6365
" -e echo file to roguelog\n"
66+
" -E set emacs mode\n"
6467
" -f rogue set path to rogue\n"
6568
" -H disable \"halftime\" show\n"
6669
" -p play back roguelog\n"
6770
" -P player set path to player\n"
6871
" -r use saved game\n"
69-
" -s print scores only\n"
72+
" -s print rogomatic scores from the default rogomatic score file\n"
73+
" -s rogue_ver print scores the rogomatic score file for a given rogue version\n"
7074
" -S ROGOSEED set $ROGOSEED environment variable for rogue\n"
7175
" -t give status lines only\n"
7276
" -u start up in user mode\n"
7377
" -w set watched mode\n"
74-
" -E set emacs mode\n"
7578
"\n"
7679
"Exit codes:\n"
7780
" 0 all OK\n"
@@ -114,6 +117,7 @@ main (int argc, char *argv[])
114117
char rogue_dir[MU_BUF + 1]; /* directory for the rogue files, not impacted by -d */
115118
unsigned int dnum = 0; /* rogue dungeon number to set */
116119
int player_lock_fd = -1; /* player lock file descriptor */
120+
char *rogue_ver = DEFVER; /* rogue version string */
117121
extern char *optarg; /* option argument */
118122
extern int optind; /* argv index of the next arg */
119123
int i;
@@ -147,7 +151,7 @@ main (int argc, char *argv[])
147151
/*
148152
* parse args
149153
*/
150-
while ((i = getopt (argc, argv, "hVcdD:ef:HpP:rsS:tuwE:")) != -1) {
154+
while ((i = getopt (argc, argv, "hVcdD:ef:HpP:rs:S:tuwE:")) != -1) {
151155
switch (i) {
152156
case 'h': /* -h ==> print usage message */
153157
fprintf (stderr, usage, program, prog, VERSION);
@@ -200,6 +204,7 @@ main (int argc, char *argv[])
200204

201205
case 's': /* -s ==> Give scores only */
202206
score = true;
207+
rogue_ver = optarg;
203208
break;
204209

205210
case 'S': /* -S SEED ==> set the rogomatic seed */
@@ -223,19 +228,31 @@ main (int argc, char *argv[])
223228
break;
224229

225230
case ':':
226-
fprintf(stderr, "%s: requires an argument -- %c\n", program, optopt);
227-
fprintf (stderr, usage, program, prog, VERSION);
228-
exit (3);
231+
/*
232+
* case: -s without an argument
233+
*/
234+
if (optopt == 's') {
235+
score = true;
236+
rogue_ver = DEFVER; /* use the default rogue version */
237+
238+
/*
239+
* otherwise report missing argument
240+
*/
241+
} else {
242+
fprintf (stderr, "%s: requires an argument -- %c\n", program, optopt);
243+
fprintf (stderr, usage, program, prog, VERSION);
244+
exit (3);
245+
}
229246
break;
230247

231248
case '?':
232-
fprintf(stderr, "%s: unknown option -- %c\n", program, optopt);
249+
fprintf (stderr, "%s: unknown option -- %c\n", program, optopt);
233250
fprintf (stderr, usage, program, prog, VERSION);
234251
exit (3);
235252
break;
236253

237254
default:
238-
fprintf(stderr, "%s: invalid -flag\n", program);
255+
fprintf (stderr, "%s: invalid -flag\n", program);
239256
fprintf (stderr, usage, program, prog, VERSION);
240257
exit (3);
241258
break;
@@ -292,6 +309,14 @@ main (int argc, char *argv[])
292309
*/
293310
set_rgmdir (time_subpath);
294311

312+
/*
313+
* -s [version] dump score
314+
*/
315+
if (score) {
316+
dumpscore (rogue_ver);
317+
exit (0);
318+
}
319+
295320
/*
296321
* verify that the player lock is not already locked
297322
*
@@ -387,14 +412,6 @@ main (int argc, char *argv[])
387412
"terse", "noflush", "jump", "seefloor", "nopassgo", "tombstone", "slow", getname (), "apricot",
388413
rogue_dir, "rogue.sav", rogue_dir, "rogue.scr", rogue_dir, "rogue.lck");
389414

390-
/*
391-
* special execution case: dumping rogomatic score
392-
*/
393-
if (score) {
394-
dumpscore (argc==1 ? argv[0] : DEFVER);
395-
exit (0);
396-
}
397-
398415
/*
399416
* special execution case: replay log
400417
*/
@@ -480,7 +497,7 @@ main (int argc, char *argv[])
480497

481498
if (rfile != NULL) {
482499
rogue_savefile = form_path (rgmdir, "rogue.sav");
483-
execl (rfile, "rogue", "-S", "-r", rogue_savefile, NULL);
500+
execl (rfile, "rogue", "-S", "--", rogue_savefile, NULL);
484501
fprintf (stderr, "ERROR: %s: file: %s line: %d dungeon: %u rogue default restore exec failed: %s -S -r %s: %s\n",
485502
__func__, __FILE__, __LINE__, dnum, rfile, rogue_savefile, strerror (errno));
486503
} else {
@@ -491,7 +508,7 @@ main (int argc, char *argv[])
491508
} else if (argc > 0) {
492509

493510
if (rfile != NULL) {
494-
execl (rfile, "rogue", "-S", argv[0], NULL);
511+
execl (rfile, "rogue", "-S", "--", argv[0], NULL);
495512
fprintf (stderr, "ERROR: %s: file: %s line: %d dungeon: %u rogue restore exec failed: %s -S %s: %s\n",
496513
__func__, __FILE__, __LINE__, dnum, rfile, argv[0], strerror (errno));
497514
} else {

0 commit comments

Comments
 (0)