From 26bee340062a23f42a25b8435d492f985663e95d Mon Sep 17 00:00:00 2001 From: crc Date: Tue, 22 Jan 2019 14:35:31 +0000 Subject: [PATCH] rre: add -u command line option FossilOrigin-Name: 56a0437f8913f2f670fc6244e102d23f608a40f67c0e93d66bcc471a2ce43555 --- RELEASE_NOTES.md | 2 ++ interfaces/rre.c | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index bcaea41..e6458bb 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -29,6 +29,8 @@ ### retro - add random number generator +- add `-u filename` startup parameter to allow selection of + image file ### retro-compiler diff --git a/interfaces/rre.c b/interfaces/rre.c index a3a8dba..c1ddadc 100644 --- a/interfaces/rre.c +++ b/interfaces/rre.c @@ -402,6 +402,8 @@ void help(char *exename) { printf(" Suppress the 'ok' prompt and keyboard echo in interactive mode\n\n"); printf(" -f filename\n"); printf(" Run the contents of the specified file\n\n"); + printf(" -u filename\n"); + printf(" Use the image in the specified file instead of the internal one\n\n"); printf(" -t\n"); printf(" Run tests (in ``` blocks) in any loaded files\n\n"); } @@ -484,6 +486,9 @@ int main(int argc, char **argv) { files[fsp] = argv[i + 1]; fsp++; i++; + } else if (strcmp(argv[i], "-u") == 0) { + i++; + ngaLoadImage(argv[i]); } else if (strcmp(argv[i], "-t") == 0) { modes[FLAG_RUN_TESTS] = 1; run_tests = 1;