Improve applet help a little. Also, if mountinfo as any mounts given, work explictly with --netdev/--nonetdev

This commit is contained in:
Roy Marples 2007-10-09 17:41:53 +00:00
parent db468457dc
commit d468572206
12 changed files with 24 additions and 31 deletions

View File

@ -20,7 +20,7 @@ static void usage (int exit_status)
for (i = 0; longopts[i].name; ++i) {
int len = printf (" -%c, --%s %s", longopts[i].val, longopts[i].name,
has_arg[longopts[i].has_arg]);
while (++len < 30)
while (++len < 37)
printf (" ");
puts (longopts_help[i]);
}

View File

@ -13,7 +13,8 @@
{ "help", 0, NULL, 'h'}, \
{ "nocolor", 0, NULL, 'C'}, \
{ "verbose", 0, NULL, 'v'}, \
{ "quiet", 0, NULL, 'q'},
{ "quiet", 0, NULL, 'q'}, \
{ NULL, 0, NULL, 0 }
#define longopts_help_COMMON \
"Display this help output (duh)", \

View File

@ -141,14 +141,13 @@ static struct option longopts[] = {
{ "user", 1, NULL, 'u'},
{ "group", 1, NULL, 'g'},
longopts_COMMON
{ NULL, 0, NULL, 0}
};
static const char * const longopts_help[] = {
"",
"",
"",
"",
"",
"Check if a directory",
"Check if a file",
"Mode to check",
"User to check",
"Group to check",
longopts_help_COMMON
};
#include "_usage.c"

View File

@ -80,7 +80,6 @@ static struct option longopts[] = {
{ "fork-ldconfig", 0, NULL, 'l'},
{ "no-ldconfig", 0, NULL, 'L'},
longopts_COMMON
{ NULL, 0, NULL, 0}
};
static const char * const longopts_help[] = {
"Fork ldconfig into the background",

View File

@ -71,7 +71,6 @@ static struct option longopts[] = {
{ "passno", 1, NULL, 'p'},
{ "fstype", 1, NULL, 't'},
longopts_COMMON
{ NULL, 0, NULL, 0}
};
static const char * const longopts_help[] = {
"Extract the options field",

View File

@ -72,10 +72,10 @@ static int process_mount (char ***list, struct args *args,
return (-1);
#endif
if (args->netdev == net_yes && netdev != -1) {
if (args->netdev == net_yes && (netdev != -1 || args->mounts)) {
if (netdev != 0)
return (1);
} else if (args->netdev == net_no && netdev != -1) {
} else if (args->netdev == net_no && (netdev != -1 || args->mounts)) {
if (netdev != 1)
return (1);
} else {
@ -307,20 +307,21 @@ static struct option longopts[] = {
{ "netdev", 0, NULL, 'e'},
{ "nonetdev", 0, NULL, 'E'},
longopts_COMMON
{ NULL, 0, NULL, 0}
};
static const char * const longopts_help[] = {
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"fstype regex to find",
"fstype regex to skip",
"node regex to find",
"node regex to skip",
"options regex to find",
"options regex to skip",
"point regex to find",
"point regex to skip",
"print options",
"print fstype",
"print node",
"is it a network device",
"is it not a network device",
longopts_help_COMMON
};
#include "_usage.c"

View File

@ -45,7 +45,6 @@ static struct option longopts[] = {
{ "strict", 0, NULL, 's'},
{ "update", 0, NULL, 'u'},
longopts_COMMON
{ NULL, 0, NULL, 0}
};
static const char * const longopts_help[] = {
"Type(s) of dependency to list",

View File

@ -69,13 +69,12 @@ static const struct option longopts[] = {
{"servicelist", 0, NULL, 's'},
{"unused", 0, NULL, 'u'},
longopts_COMMON
{NULL, 0, NULL, 0}
};
static const char * const longopts_help[] = {
"Show services from all run levels",
"Show list of run levels",
"Show service list",
"Show services not assigned to any run level",
"Show services not assigned to any runlevel",
longopts_help_COMMON
};
#include "_usage.c"

View File

@ -116,7 +116,6 @@ static struct option longopts[] = {
{ "delete", 0, NULL, 'd'},
{ "show", 0, NULL, 's'},
longopts_COMMON
{ NULL, 0, NULL, 0}
};
static const char * const longopts_help[] = {
"Add the init.d to runlevels",

View File

@ -731,7 +731,6 @@ static void run_script (const char *script) {
#define getoptstring getoptstring_COMMON
static struct option longopts[] = {
longopts_COMMON
{ NULL, 0, NULL, 0}
};
static const char * const longopts_help[] = {
longopts_help_COMMON

View File

@ -983,7 +983,6 @@ static struct option longopts[] = {
{ "ifstarted", 0, NULL, 's'},
{ "nodeps", 0, NULL, 'D'},
longopts_COMMON
{ NULL, 0, NULL, 0}
};
static const char * const longopts_help[] = {
"",

View File

@ -484,7 +484,6 @@ static struct option longopts[] = {
{ "stdout", 1, NULL, '1'},
{ "stderr", 1, NULL, '2'},
longopts_COMMON
{ NULL, 0, NULL, 0}
};
static const char * const longopts_help[] = {
"Stop daemon",