From: Josh Poimboeuf <jpoimboe@redhat.com>
To: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@kernel.org>
Subject: Re: [PATCH] objtool: Print top level commands on incorrect usage
Date: Fri, 13 Oct 2017 11:38:21 -0500 [thread overview]
Message-ID: <20171013163821.2dnqljq2lxyvkfqu@treble> (raw)
In-Reply-To: <1507882872-26138-1-git-send-email-kamalesh@linux.vnet.ibm.com>
On Fri, Oct 13, 2017 at 01:51:12PM +0530, Kamalesh Babulal wrote:
> Maintain the consistency with objtool subcommands, by
> printing cmd_usage() of top level commands, along with
> the error. When incorrect option/command is passed to
> objtool. Also change the exit code to 129, like other
> objtool subcommands.
>
> 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
>
> Cc: Ingo Molnar <mingo@kernel.org>
> Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
> ---
> tools/objtool/objtool.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/tools/objtool/objtool.c b/tools/objtool/objtool.c
> index 31e0f91..07f3299 100644
> --- a/tools/objtool/objtool.c
> +++ b/tools/objtool/objtool.c
> @@ -70,7 +70,7 @@ static void cmd_usage(void)
>
> printf("\n");
>
> - exit(1);
> + exit(129);
For consistency with the rest of the code, this should be -1 instead of
129 (though the end result is the same).
--
Josh
next prev parent reply other threads:[~2017-10-13 16:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-13 8:21 Kamalesh Babulal
2017-10-13 16:38 ` Josh Poimboeuf [this message]
2017-10-14 14:38 ` Kamalesh Babulal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171013163821.2dnqljq2lxyvkfqu@treble \
--to=jpoimboe@redhat.com \
--cc=kamalesh@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®