From 9df8726f5fe78b5b50462081782894b6c32814f4 Mon Sep 17 00:00:00 2001 From: PQCraft <58464017+PQCraft@users.noreply.github.com> Date: Tue, 21 Sep 2021 06:48:45 -0400 Subject: [PATCH] 0.22.3 Fixed an option error that allowed two or more -r's to be used and prevented -i from being used before a -r --- clibasic.c | 4 ++-- docs/clibasic.man | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/clibasic.c b/clibasic.c index 7923e5d..8c6cefd 100644 --- a/clibasic.c +++ b/clibasic.c @@ -115,7 +115,7 @@ // Base defines -char VER[] = "0.22.2"; +char VER[] = "0.22.3"; #if defined(__linux__) char OSVER[] = "Linux"; @@ -692,7 +692,7 @@ int main(int argc, char** argv) { info = true; if (shortopt) goto chkshortopt; } else if (!strcmp(argv[i], "--redirection") || (shortopt && argv[i][shortopti] == 'r')) { - if (info) {fputs("Incorrect number of options passed.\n", stderr); exit(1);} + if (redirection) {fputs("Incorrect number of options passed.\n", stderr); exit(1);} redirection = true; if (shortopt) goto chkshortopt; } else if (!strcmp(argv[i], "--command") || !strcmp(argv[i], "-c")) { diff --git a/docs/clibasic.man b/docs/clibasic.man index 08f3444..41a7e35 100644 --- a/docs/clibasic.man +++ b/docs/clibasic.man @@ -34,6 +34,9 @@ Skips searching for autorun programs. .TP \fB\-i\fR, \fB\-\-info\fR Enables the info text. +.TP +\fB\-r\fR, \fB\-\-redirection\fR +Enables support for redirecting STDIN, STDOUT, and STDERR. .SH EXAMPLES .TP \fBclibasic\fR