wmfsm: Impove version number handling.
In particular, - Add new --version command line option. (This was already documented in the manpage.) Remove this information from the --help text. Also took the opportunity to properly align the --fire line in the --help text. - Remove WMFSM_VERSION macro in favor of PACKAGE_VERSION from autconf. - Remove hard-coded version number at top of source file for maintainability.
This commit is contained in:
parent
d379db1092
commit
b117ac7474
1 changed files with 8 additions and 6 deletions
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* wmfsm-0.33 (C) 1999 Stefan Eilemann (Stefan.Eilemann@dlr.de)
|
* wmfsm (C) 1999 Stefan Eilemann (Stefan.Eilemann@dlr.de)
|
||||||
*
|
*
|
||||||
* - Shows file system usage ala mfsm
|
* - Shows file system usage ala mfsm
|
||||||
*
|
*
|
||||||
|
@ -100,7 +100,6 @@
|
||||||
* coz irix has max of 100000L :(.
|
* coz irix has max of 100000L :(.
|
||||||
*/
|
*/
|
||||||
#define DELAY_10 99999L
|
#define DELAY_10 99999L
|
||||||
#define WMFSM_VERSION "0.33"
|
|
||||||
#define LENMP 5 /*max 10, number char for mountpoint */
|
#define LENMP 5 /*max 10, number char for mountpoint */
|
||||||
|
|
||||||
/*modes for drawing*/
|
/*modes for drawing*/
|
||||||
|
@ -418,10 +417,11 @@ ParseCMDLine(int argc, char *argv[])
|
||||||
{"delay", required_argument, 0, 'd'},
|
{"delay", required_argument, 0, 'd'},
|
||||||
{"appearance", required_argument, 0, 'a'},
|
{"appearance", required_argument, 0, 'a'},
|
||||||
{"help", no_argument, 0, 'h'},
|
{"help", no_argument, 0, 'h'},
|
||||||
|
{"version", no_argument, 0, 'v'},
|
||||||
{0, 0, 0, 0}
|
{0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
while (1) {
|
while (1) {
|
||||||
c = getopt_long(argc, argv, "a:bd:fhn", long_options, &option_index);
|
c = getopt_long(argc, argv, "a:bd:fhnv", long_options, &option_index);
|
||||||
if (c == -1)
|
if (c == -1)
|
||||||
break;
|
break;
|
||||||
switch (c) {
|
switch (c) {
|
||||||
|
@ -445,6 +445,9 @@ ParseCMDLine(int argc, char *argv[])
|
||||||
case 'n':
|
case 'n':
|
||||||
mode = NORMAL;
|
mode = NORMAL;
|
||||||
break;
|
break;
|
||||||
|
case 'v':
|
||||||
|
printf("wmfsm version: %s\n", PACKAGE_VERSION);
|
||||||
|
exit(0);
|
||||||
case '?':
|
case '?':
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -459,10 +462,9 @@ void
|
||||||
print_usage()
|
print_usage()
|
||||||
{
|
{
|
||||||
|
|
||||||
printf("\nwmfsm version: %s\n", WMFSM_VERSION);
|
printf("usage: wmfsm \n");
|
||||||
printf("\nusage: wmfsm \n");
|
|
||||||
printf("\t--normal, -n\t\tDraw bars in normal mode.\n");
|
printf("\t--normal, -n\t\tDraw bars in normal mode.\n");
|
||||||
printf("\t--fire, -f\t\t\tDraw bars in fire mode.\n");
|
printf("\t--fire, -f\t\tDraw bars in fire mode.\n");
|
||||||
printf("\t--[no]blink\t\tBlinks if a filesystem is 95 percent full.\n");
|
printf("\t--[no]blink\t\tBlinks if a filesystem is 95 percent full.\n");
|
||||||
printf("\t-display <Display>\tUse alternate X display.\n");
|
printf("\t-display <Display>\tUse alternate X display.\n");
|
||||||
printf("\t--delay <number>, -d\tUse a delay that is not the default.\n");
|
printf("\t--delay <number>, -d\tUse a delay that is not the default.\n");
|
||||||
|
|
Loading…
Reference in a new issue