Skip to content

Commit 6a93bb7

Browse files
kamalesh-babulalingomolnar
authored andcommitted
objtool: Print top level commands on incorrect usage
Print top-level objtool commands, along with the error on incorrect command line usage. Objtool command line parser exit's with code 129, for incorrect usage. Convert the cmd_usage() exit code also, to maintain consistency across objtool. After the patch: $ ./objtool -j Unknown option: -j usage: objtool COMMAND [ARGS] Commands: check Perform stack metadata validation on an object file orc Generate in-place ORC unwind tables for an object file $ echo $? 129 Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> Acked-by: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/1507992474-16142-1-git-send-email-kamalesh@linux.vnet.ibm.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 2704fbb commit 6a93bb7

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

‎tools/objtool/objtool.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ static void cmd_usage(void)
7070

7171
printf("\n");
7272

73-
exit(1);
73+
exit(129);
7474
}
7575

7676
static void handle_options(int *argc, const char ***argv)
@@ -86,9 +86,7 @@ static void handle_options(int *argc, const char ***argv)
8686
break;
8787
} else {
8888
fprintf(stderr, "Unknown option: %s\n", cmd);
89-
fprintf(stderr, "\n Usage: %s\n",
90-
objtool_usage_string);
91-
exit(1);
89+
cmd_usage();
9290
}
9391

9492
(*argv)++;

0 commit comments

Comments
 (0)