1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Added command line option -V

This commit is contained in:
Klaus Schmidinger 2002-03-29 10:10:04 +01:00
parent ce5a52c906
commit 2625c46232
3 changed files with 15 additions and 7 deletions

View File

@ -1138,3 +1138,4 @@ Video Disk Recorder Revision History
- Fixed scrolling the "Channels" menu in case the cursor ends up on a group - Fixed scrolling the "Channels" menu in case the cursor ends up on a group
delimiter (thanks to Bernd Zierath for helping to debug this one). delimiter (thanks to Bernd Zierath for helping to debug this one).
- Added a manual page vdr(1). - Added a manual page vdr(1).
- New command command line option '-V' to display the VDR version.

10
vdr.1
View File

@ -8,13 +8,12 @@
.\" License as specified in the file COPYING that comes with the .\" License as specified in the file COPYING that comes with the
.\" vdr distribution. .\" vdr distribution.
.\" .\"
.\" $Id: vdr.1 1.1 2002/03/24 14:10:00 kls Exp $ .\" $Id: vdr.1 1.2 2002/03/29 10:10:04 kls Exp $
.\" .\"
.TH vdr 1 "24 Mar 2002" "1.0.0" "Video Disk Recorder" .TH vdr 1 "29 Mar 2002" "1.0.0" "Video Disk Recorder"
.SH NAME .SH NAME
vdr - the Video Disk Recorder vdr - the Video Disk Recorder
.SH SYNOPSIS .SH SYNOPSIS
.\" The general command line
.B vdr .B vdr
[options] [options]
.SH DESCRIPTION .SH DESCRIPTION
@ -91,6 +90,9 @@ Set the controlling terminal.
Use \fIdir\fR as video directory. Use \fIdir\fR as video directory.
The default is \fI/video\fR. The default is \fI/video\fR.
.TP .TP
.B -V, --version
Print version information and exit.
.TP
.BI -w\ sec ,\ --watchdog= sec .BI -w\ sec ,\ --watchdog= sec
Activate the watchdog timer with a timeout of \fIsec\fR seconds. Activate the watchdog timer with a timeout of \fIsec\fR seconds.
A value of \fB0\fR (default) disables the watchdog. A value of \fB0\fR (default) disables the watchdog.
@ -152,7 +154,7 @@ also be read at program startup to have the full EPG data available immediately.
.BR vdr (5) .BR vdr (5)
.SH AUTHOR .SH AUTHOR
Written by Klaus Schmidinger, with contributions from many others. Written by Klaus Schmidinger, with contributions from many others.
See the file \fICONTRIBUTORS\fR in the source distribution. See the file \fICONTRIBUTORS\fR in the \fBvdr\fR source distribution.
.SH REPORTING BUGS .SH REPORTING BUGS
Report bugs to <vdr-bugs@cadsoft.de>. Report bugs to <vdr-bugs@cadsoft.de>.
.SH COPYRIGHT .SH COPYRIGHT

11
vdr.c
View File

@ -22,7 +22,7 @@
* *
* The project's page is at http://www.cadsoft.de/people/kls/vdr * The project's page is at http://www.cadsoft.de/people/kls/vdr
* *
* $Id: vdr.c 1.101 2002/03/09 17:10:16 kls Exp $ * $Id: vdr.c 1.102 2002/03/29 10:09:20 kls Exp $
*/ */
#include <getopt.h> #include <getopt.h>
@ -101,6 +101,7 @@ int main(int argc, char *argv[])
{ "record", required_argument, NULL, 'r' }, { "record", required_argument, NULL, 'r' },
{ "shutdown", required_argument, NULL, 's' }, { "shutdown", required_argument, NULL, 's' },
{ "terminal", required_argument, NULL, 't' }, { "terminal", required_argument, NULL, 't' },
{ "version", no_argument, NULL, 'V' },
{ "video", required_argument, NULL, 'v' }, { "video", required_argument, NULL, 'v' },
{ "watchdog", required_argument, NULL, 'w' }, { "watchdog", required_argument, NULL, 'w' },
{ NULL } { NULL }
@ -108,7 +109,7 @@ int main(int argc, char *argv[])
int c; int c;
int option_index = 0; int option_index = 0;
while ((c = getopt_long(argc, argv, "a:c:dD:E:hl:mp:r:s:t:v:w:", long_options, &option_index)) != -1) { while ((c = getopt_long(argc, argv, "a:c:dD:E:hl:mp:r:s:t:v:Vw:", long_options, &option_index)) != -1) {
switch (c) { switch (c) {
case 'a': cDvbApi::SetAudioCommand(optarg); case 'a': cDvbApi::SetAudioCommand(optarg);
break; break;
@ -139,7 +140,7 @@ int main(int argc, char *argv[])
" %s); use '-E-' to disable this\n" " %s); use '-E-' to disable this\n"
" if FILE is a directory, the default EPG file will be\n" " if FILE is a directory, the default EPG file will be\n"
" created in that directory\n" " created in that directory\n"
" -h, --help display this help and exit\n" " -h, --help print this help and exit\n"
" -l LEVEL, --log=LEVEL set log level (default: 3)\n" " -l LEVEL, --log=LEVEL set log level (default: 3)\n"
" 0 = no logging, 1 = errors only,\n" " 0 = no logging, 1 = errors only,\n"
" 2 = errors and info, 3 = errors, info and debug\n" " 2 = errors and info, 3 = errors, info and debug\n"
@ -149,6 +150,7 @@ int main(int argc, char *argv[])
" -r CMD, --record=CMD call CMD before and after a recording\n" " -r CMD, --record=CMD call CMD before and after a recording\n"
" -s CMD, --shutdown=CMD call CMD to shutdown the computer\n" " -s CMD, --shutdown=CMD call CMD to shutdown the computer\n"
" -t TTY, --terminal=TTY controlling tty\n" " -t TTY, --terminal=TTY controlling tty\n"
" -V, --version print version information and exit\n"
" -v DIR, --video=DIR use DIR as video directory (default: %s)\n" " -v DIR, --video=DIR use DIR as video directory (default: %s)\n"
" -w SEC, --watchdog=SEC activate the watchdog timer with a timeout of SEC\n" " -w SEC, --watchdog=SEC activate the watchdog timer with a timeout of SEC\n"
" seconds (default: %d); '0' disables the watchdog\n" " seconds (default: %d); '0' disables the watchdog\n"
@ -186,6 +188,9 @@ int main(int argc, char *argv[])
break; break;
case 't': Terminal = optarg; case 't': Terminal = optarg;
break; break;
case 'V': printf("vdr, version %s\n", VDRVERSION);
return 0;
break;
case 'v': VideoDirectory = optarg; case 'v': VideoDirectory = optarg;
while (optarg && *optarg && optarg[strlen(optarg) - 1] == '/') while (optarg && *optarg && optarg[strlen(optarg) - 1] == '/')
optarg[strlen(optarg) - 1] = 0; optarg[strlen(optarg) - 1] = 0;