Improve applet help a little. Also, if mountinfo as any mounts given, work explictly with --netdev/--nonetdev
This commit is contained in:
parent
db468457dc
commit
d468572206
@ -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]);
|
||||
}
|
||||
|
@ -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)", \
|
||||
|
@ -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"
|
||||
|
@ -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",
|
||||
|
@ -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",
|
||||
|
@ -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"
|
||||
|
@ -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",
|
||||
|
@ -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"
|
||||
|
@ -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",
|
||||
|
1
src/rc.c
1
src/rc.c
@ -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
|
||||
|
@ -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[] = {
|
||||
"",
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user