All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ] emulator: Fix command line parameters with optional argument
@ 2020-04-06 20:14 Olivier Martin
  2020-04-07  0:16 ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 2+ messages in thread
From: Olivier Martin @ 2020-04-06 20:14 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Olivier Martin

Some parameters were missing the indication that additional
argument could be expected.
---
 emulator/main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/emulator/main.c b/emulator/main.c
index 68c53488e..3e32bf95d 100644
--- a/emulator/main.c
+++ b/emulator/main.c
@@ -58,8 +58,10 @@ static void usage(void)
 		"\t-s                    Create local server sockets\n"
 		"\t-l [num]              Number of local controllers\n"
 		"\t-L                    Create LE only controller\n"
+		"\t-U [num]              Number of test LE controllers\n"
 		"\t-B                    Create BR/EDR only controller\n"
 		"\t-A                    Create AMP controller\n"
+		"\t-T [num]              Number of test AMP controllers\n"
 		"\t-h, --help            Show help options\n");
 }
 
@@ -97,7 +99,7 @@ int main(int argc, char *argv[])
 	for (;;) {
 		int opt;
 
-		opt = getopt_long(argc, argv, "Ssl::LBAUTvh",
+		opt = getopt_long(argc, argv, "Ssl::LBAU::T::vh",
 						main_options, NULL);
 		if (opt < 0)
 			break;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH BlueZ] emulator: Fix command line parameters with optional argument
  2020-04-06 20:14 [PATCH BlueZ] emulator: Fix command line parameters with optional argument Olivier Martin
@ 2020-04-07  0:16 ` Luiz Augusto von Dentz
  0 siblings, 0 replies; 2+ messages in thread
From: Luiz Augusto von Dentz @ 2020-04-07  0:16 UTC (permalink / raw)
  To: Olivier Martin; +Cc: linux-bluetooth

Hi Olivier,

On Mon, Apr 6, 2020 at 3:45 PM Olivier Martin <olivier@labapart.com> wrote:
>
> Some parameters were missing the indication that additional
> argument could be expected.
> ---
>  emulator/main.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/emulator/main.c b/emulator/main.c
> index 68c53488e..3e32bf95d 100644
> --- a/emulator/main.c
> +++ b/emulator/main.c
> @@ -58,8 +58,10 @@ static void usage(void)
>                 "\t-s                    Create local server sockets\n"
>                 "\t-l [num]              Number of local controllers\n"
>                 "\t-L                    Create LE only controller\n"
> +               "\t-U [num]              Number of test LE controllers\n"
>                 "\t-B                    Create BR/EDR only controller\n"
>                 "\t-A                    Create AMP controller\n"
> +               "\t-T [num]              Number of test AMP controllers\n"
>                 "\t-h, --help            Show help options\n");
>  }

Actually optional arguments cannot have spaces in between the option,
that is why one need to do -L2 for example as -L 2 would ignore the
number, perhaps we should actually document the long version with
--le=2 which should probably be the prefered method.

> @@ -97,7 +99,7 @@ int main(int argc, char *argv[])
>         for (;;) {
>                 int opt;
>
> -               opt = getopt_long(argc, argv, "Ssl::LBAUTvh",
> +               opt = getopt_long(argc, argv, "Ssl::LBAU::T::vh",
>                                                 main_options, NULL);
>                 if (opt < 0)
>                         break;
> --
> 2.17.1
>


-- 
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-04-07  0:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-06 20:14 [PATCH BlueZ] emulator: Fix command line parameters with optional argument Olivier Martin
2020-04-07  0:16 ` Luiz Augusto von Dentz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.