[Pdbg] [PATCH 02/29] main: Alphabetise getopt()
Russell Currey
ruscur at russell.cc
Fri Feb 9 16:42:43 AEDT 2018
On Fri, 2018-02-09 at 15:38 +1100, Cyril Bur wrote:
> Signed-off-by: Cyril Bur <cyrilbur at gmail.com>
> ---
Great patch.
Reviewed-by: Russell Currey <ruscur at russell.cc>
> src/main.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/src/main.c b/src/main.c
> index 8570568..2c705b4 100644
> --- a/src/main.c
> +++ b/src/main.c
> @@ -240,18 +240,19 @@ static bool parse_options(int argc, char
> *argv[])
> static int current_processor = INT_MAX, current_chip =
> INT_MAX, current_thread = INT_MAX;
> struct option long_opts[] = {
> {"all", no_argument,
> NULL, 'a'},
> - {"processor", required_argument,
> NULL, 'p'},
> - {"chip", required_argument, NU
> LL, 'c'},
> - {"thread", required_argument,
> NULL, 't'},
> {"backend", required_argument,
> NULL, 'b'},
> + {"chip", required_argument, NU
> LL, 'c'},
> {"device", required_argument,
> NULL, 'd'},
> + {"help", no_argument,
> NULL, 'h'},
> + {"processor", required_argument,
> NULL, 'p'},
> {"slave-address", required_argument, N
> ULL, 's'},
> + {"thread", required_argument,
> NULL, 't'},
> {"version", no_argument,
> NULL, 'V'},
> - {"help", no_argument,
> NULL, 'h'},
> + {NULL, 0,
> NULL, 0}
> };
>
> do {
> - c = getopt_long(argc, argv, "-p:c:t:b:d:s:haV",
> long_opts, NULL);
> + c = getopt_long(argc, argv, "-ab:c:d:hp:s:t:V",
> long_opts, NULL);
> switch(c) {
> case 1:
> /* Positional argument */
More information about the Pdbg
mailing list