From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752483AbdJMQiY (ORCPT ); Fri, 13 Oct 2017 12:38:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46852 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752396AbdJMQiX (ORCPT ); Fri, 13 Oct 2017 12:38:23 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7ED1383F40 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jpoimboe@redhat.com Date: Fri, 13 Oct 2017 11:38:21 -0500 From: Josh Poimboeuf To: Kamalesh Babulal Cc: linux-kernel@vger.kernel.org, Ingo Molnar Subject: Re: [PATCH] objtool: Print top level commands on incorrect usage Message-ID: <20171013163821.2dnqljq2lxyvkfqu@treble> References: <1507882872-26138-1-git-send-email-kamalesh@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1507882872-26138-1-git-send-email-kamalesh@linux.vnet.ibm.com> User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 13 Oct 2017 16:38:23 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Signed-off-by: Kamalesh Babulal > --- > 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