wmbattery: Add -v option to display version number.
Also, in order to facilitate this, keep track of version number in configure.ac. It was previously only mentioned in ChangeLog.
This commit is contained in:
parent
8b8f2745fb
commit
a750a6b25f
|
@ -1,5 +1,5 @@
|
|||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_INIT(wmbattery.c)
|
||||
AC_INIT(wmbattery.c, 2.44)
|
||||
AC_CONFIG_HEADER(config.h)
|
||||
|
||||
AC_CONFIG_AUX_DIR(autoconf)
|
||||
|
|
|
@ -314,7 +314,7 @@ char *parse_commandline(int argc, char *argv[])
|
|||
char *s;
|
||||
|
||||
while (c != -1) {
|
||||
c = getopt(argc, argv, "hd:g:if:b:w:c:l:es:a:x:");
|
||||
c = getopt(argc, argv, "hd:g:if:b:w:c:l:es:a:x:v");
|
||||
switch (c) {
|
||||
case 'h':
|
||||
printf("Usage: wmbattery [options]\n");
|
||||
|
@ -330,6 +330,7 @@ char *parse_commandline(int argc, char *argv[])
|
|||
printf("\t-s granularity\tignore fluctuations less than granularity%% (implies -e)\n");
|
||||
printf("\t-a file\t\twhen critical send file to /dev/audio\n");
|
||||
printf("\t-x command\twhen critical execute this command\n");
|
||||
printf("\t-v\t\tdisplay version number\n");
|
||||
exit(0);
|
||||
break;
|
||||
case 'd':
|
||||
|
@ -374,6 +375,10 @@ char *parse_commandline(int argc, char *argv[])
|
|||
case 'x':
|
||||
crit_command = strdup(optarg);
|
||||
break;
|
||||
case 'v':
|
||||
printf("wmbattery "PACKAGE_VERSION"\n");
|
||||
exit(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue