rc-status: all flags respect '-f'

This commit is contained in:
anon 2022-12-24 14:51:40 +01:00 committed by Mike Frysinger
parent 63a5ee3d8c
commit 476272be0c

View File

@ -65,8 +65,8 @@ const char * const longopts_help[] = {
longopts_help_COMMON longopts_help_COMMON
}; };
const char *usagestring = "" \ const char *usagestring = "" \
"Usage: rc-status [options] -f ini <runlevel>...\n" \ "Usage: rc-status [options] [-f ini] <runlevel>...\n" \
" or: rc-status [options] [-a | -c | -l | -m | -r | -s | -u]"; " or: rc-status [options] [-f ini] [-a | -c | -l | -m | -r | -s | -u]";
static RC_DEPTREE *deptree; static RC_DEPTREE *deptree;
static RC_STRINGLIST *types; static RC_STRINGLIST *types;
@ -316,7 +316,7 @@ int main(int argc, char **argv)
free(s->value); free(s->value);
free(s); free(s);
} }
print_services(NULL, services, FORMAT_DEFAULT); print_services(NULL, services, format);
goto exit; goto exit;
case 'r': case 'r':
runlevel = rc_runlevel_get(); runlevel = rc_runlevel_get();
@ -328,12 +328,12 @@ int main(int argc, char **argv)
TAILQ_FOREACH_SAFE(s, services, entries, t) TAILQ_FOREACH_SAFE(s, services, entries, t)
if (!rc_service_value_get(s->value, "child_pid")) if (!rc_service_value_get(s->value, "child_pid"))
TAILQ_REMOVE(services, s, entries); TAILQ_REMOVE(services, s, entries);
print_services(NULL, services, FORMAT_DEFAULT); print_services(NULL, services, format);
goto exit; goto exit;
/* NOTREACHED */ /* NOTREACHED */
case 's': case 's':
services = rc_services_in_runlevel(NULL); services = rc_services_in_runlevel(NULL);
print_services(NULL, services, FORMAT_DEFAULT); print_services(NULL, services, format);
goto exit; goto exit;
/* NOTREACHED */ /* NOTREACHED */
case 'u': case 'u':
@ -348,7 +348,7 @@ int main(int argc, char **argv)
break; break;
} }
} }
print_services(NULL, services, FORMAT_DEFAULT); print_services(NULL, services, format);
goto exit; goto exit;
/* NOTREACHED */ /* NOTREACHED */