From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx> This sets enmpty string ("") when argument don't set any optarg so the application can tell when an option was set or not. --- src/shared/shell.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/shell.c b/src/shared/shell.c index dfda8128af91..4658819a4bde 100644 --- a/src/shared/shell.c +++ b/src/shared/shell.c @@ -1158,7 +1158,7 @@ void bt_shell_init(int argc, char **argv, const struct bt_shell_opt *opt) return; } - *opt->optarg[index - offset] = optarg; + *opt->optarg[index - offset] = optarg ? : ""; } index = -1; -- 2.37.2