From ec158dea0bdc8bf4767fe048056178a823a2033b Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sat, 19 Jan 2013 16:37:00 -0800 Subject: Add -V option to print version number Signed-off-by: Alan Coopersmith --- man/sessreg.man | 3 +++ sessreg.c | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/man/sessreg.man b/man/sessreg.man index bb1d9c8..3d351bd 100644 --- a/man/sessreg.man +++ b/man/sessreg.man @@ -38,6 +38,7 @@ sessreg \- manage utmp/wtmp entries for non-init clients [-s \fIslot-number\fP] [-x \fIXservers-file\fP] [-t \fIttys-file\fP] +[-V] [-a] [-d] \fIuser-name\fP @@ -123,6 +124,8 @@ is found. .IP "\fB-t\fP \fIttys-file\fP" This specifies an alternate file which the \fI-x\fP option will use to count the number of terminal sessions on a host. +.IP "\fB-V\fP" +This option causes the command to print its version and exit. .IP "\fB-a\fP" This session should be added to utmp/wtmp. .IP "\fB-d\fP" diff --git a/sessreg.c b/sessreg.c index 1ba0d89..bdfe8f0 100644 --- a/sessreg.c +++ b/sessreg.c @@ -136,7 +136,7 @@ usage (int x) " [-L lastlog-file]" #endif "\n" - " [-t ttys-file] [-l line-name] [-h host-name]\n" + " [-t ttys-file] [-l line-name] [-h host-name] [-V]\n" " [-s slot-number] [-x servers-file] user-name\n", program_name, program_name); exit (1); @@ -241,6 +241,9 @@ main (int argc, char **argv) case 'd': dflag++; break; + case 'V': + printf("%s\n", PACKAGE_STRING); + exit (0); default: usage (1); } -- cgit v1.2.3