From f40565d5a944527bf44998271b02ab0aca643b40 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Fri, 23 Feb 2018 12:35:34 +0200 Subject: [PATCH] shared/shell: Fix timeout parameter Fix help message and add proper optstr modifier so both -t/--timeout work properly. --- src/shared/shell.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/shared/shell.c b/src/shared/shell.c index 5e9e5eac8..f1e87d009 100644 --- a/src/shared/shell.c +++ b/src/shared/shell.c @@ -780,7 +780,7 @@ static void usage(int argc, char **argv, const struct bt_shell_opt *opt) for (i = 0; opt && opt->options[i].name; i++) printf("\t--%s \t%s\n", opt->options[i].name, opt->help[i]); - printf("\t--timeout \t\tTimeout in seconds for non-interactive mode\n" + printf("\t--timeout \tTimeout in seconds for non-interactive mode\n" "\t--version \tDisplay version\n" "\t--help \t\tDisplay help\n"); } @@ -799,9 +799,9 @@ void bt_shell_init(int argc, char **argv, const struct bt_shell_opt *opt) if (opt) { memcpy(options + offset, opt->options, sizeof(struct option) * opt->optno); - snprintf(optstr, sizeof(optstr), "+hv%s", opt->optstr); + snprintf(optstr, sizeof(optstr), "+hvt:%s", opt->optstr); } else - snprintf(optstr, sizeof(optstr), "+hv"); + snprintf(optstr, sizeof(optstr), "+hvt:"); while ((c = getopt_long(argc, argv, optstr, options, &index)) != -1) { switch (c) { -- 2.47.3