[Pdbg] [PATCH 02/29] main: Alphabetise getopt()

Cyril Bur cyrilbur at gmail.com
Fri Feb 9 15:38:30 AEDT 2018


Signed-off-by: Cyril Bur <cyrilbur at gmail.com>
---
 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,	NULL,	'c'},
-		{"thread",		required_argument,	NULL,	't'},
 		{"backend",		required_argument,	NULL,	'b'},
+		{"chip",		required_argument,	NULL,	'c'},
 		{"device",		required_argument,	NULL,	'd'},
+		{"help",		no_argument,		NULL,	'h'},
+		{"processor",		required_argument,	NULL,	'p'},
 		{"slave-address",	required_argument,	NULL,	'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 */
-- 
2.16.1



More information about the Pdbg mailing list