mirror of
https://github.com/troglobit/finit.git
synced 2026-11-07 16:01:08 +00:00
Add debug flag to initctl client tool
This patch makes it possible to see debug traces when running the client program initctl, using `--debug`. Please note, this does not affect the debug command to the daemon. Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
924bf041bc
commit
4ada42f380
1 file changed
+8
-2
@@ -206,10 +206,11 @@ static int usage(int rc)
|
|||||||
{
|
{
|
||||||
fprintf(stderr, "Usage: %s [OPTIONS] <COMMAND>\n\n"
|
fprintf(stderr, "Usage: %s [OPTIONS] <COMMAND>\n\n"
|
||||||
"Options:\n"
|
"Options:\n"
|
||||||
|
" -d, --debug Debug initctl (client)\n"
|
||||||
" -v, --verbose Verbose output\n"
|
" -v, --verbose Verbose output\n"
|
||||||
" -h, --help This help text\n\n"
|
" -h, --help This help text\n\n"
|
||||||
"Commands:\n"
|
"Commands:\n"
|
||||||
" debug Toggle Finit debug\n"
|
" debug Toggle Finit (daemon) debug\n"
|
||||||
" emit <EV> Emit an event. Can be a predefined event: RELOAD, STOP,\n"
|
" emit <EV> Emit an event. Can be a predefined event: RELOAD, STOP,\n"
|
||||||
" START, or a custom string to match the event list in a\n"
|
" START, or a custom string to match the event list in a\n"
|
||||||
" service stanza, e.g: GW, IFUP:IFNAME, IFDN:IFNAME, where\n"
|
" service stanza, e.g: GW, IFUP:IFNAME, IFDN:IFNAME, where\n"
|
||||||
@@ -244,17 +245,22 @@ int main(int argc, char *argv[])
|
|||||||
};
|
};
|
||||||
struct option long_options[] = {
|
struct option long_options[] = {
|
||||||
{"help", 0, NULL, 'h'},
|
{"help", 0, NULL, 'h'},
|
||||||
|
{"debug", 0, NULL, 'd'},
|
||||||
{"verbose", 0, NULL, 'v'},
|
{"verbose", 0, NULL, 'v'},
|
||||||
{NULL, 0, NULL, 0}
|
{NULL, 0, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
verbose = 0;
|
verbose = 0;
|
||||||
while ((c = getopt_long(argc, argv, "h?v", long_options, NULL)) != EOF) {
|
while ((c = getopt_long(argc, argv, "dh?v", long_options, NULL)) != EOF) {
|
||||||
switch(c) {
|
switch(c) {
|
||||||
case 'h':
|
case 'h':
|
||||||
case '?':
|
case '?':
|
||||||
return usage(0);
|
return usage(0);
|
||||||
|
|
||||||
|
case 'd':
|
||||||
|
debug = 1;
|
||||||
|
break;
|
||||||
|
|
||||||
case 'v':
|
case 'v':
|
||||||
verbose = 1;
|
verbose = 1;
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in new issue
Block a user