mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-16 06:18:47 +02:00
Add "--version" long option.
This commit is contained in:
15
src/init.c
15
src/init.c
@@ -40,6 +40,7 @@
|
||||
#include "expr.h"
|
||||
#include "err.h"
|
||||
|
||||
static void ProcessLongArg(char const *arg);
|
||||
/***************************************************************
|
||||
*
|
||||
* Command line options recognized:
|
||||
@@ -243,6 +244,11 @@ void InitRemind(int argc, char const *argv[])
|
||||
while(*arg) arg++;
|
||||
break;
|
||||
|
||||
case '-':
|
||||
ProcessLongArg(arg);
|
||||
while(*arg) arg++;
|
||||
break;
|
||||
|
||||
case '@':
|
||||
UseVTColors = 1;
|
||||
if (*arg) {
|
||||
@@ -958,3 +964,12 @@ AddTrustedUser(char const *username)
|
||||
NumTrustedUsers++;
|
||||
}
|
||||
|
||||
static void
|
||||
ProcessLongArg(char const *arg)
|
||||
{
|
||||
if (!strcmp(arg, "version")) {
|
||||
printf("%s\n", VERSION);
|
||||
exit(0);
|
||||
}
|
||||
fprintf(ErrFp, "%s: Unknown long option --%s\n", ArgV[0], arg);
|
||||
}
|
||||
|
||||
@@ -437,6 +437,9 @@ rm -rf include_dir/ww
|
||||
# This segfaulted in 04.02.03
|
||||
../src/remind -h '-imsgprefix(x)="foo"' /dev/null >> ../tests/test.out 2>&1
|
||||
|
||||
# Test --version long option
|
||||
../src/remind --version >> ../tests/test.out 2>&1
|
||||
|
||||
# Remove references to SysInclude, which is build-specific
|
||||
grep -F -v '$SysInclude' < ../tests/test.out > ../tests/test.out.1 && mv -f ../tests/test.out.1 ../tests/test.out
|
||||
cmp -s ../tests/test.out ../tests/test.cmp
|
||||
|
||||
@@ -11695,3 +11695,4 @@ Can't open file: include_dir/ww
|
||||
Error reading include_dir/ww: Can't open file
|
||||
SECURITY: Won't read world-writable file or directory!
|
||||
Error reading include_dir/ww: No files matching *.rem
|
||||
04.02.06
|
||||
|
||||
Reference in New Issue
Block a user