From patchwork Fri Mar 8 17:38:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 86989 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 61790385DC3A for ; Fri, 8 Mar 2024 17:38:33 +0000 (GMT) X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 57C173858D33 for ; Fri, 8 Mar 2024 17:38:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 57C173858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 57C173858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709919508; cv=none; b=XlabZloEsYF03eJeO1qrpInx4wDFLepuEWFQrFLKQPo2w+5hO8vjfbclZPdR9HuU5g9OLCLZBqrux+eBvu0iCqvvrGSCS+TQJLmRE9kpzwphVgxprJ5T6QB+IHxIxU6WwnYGZJSFGauKA/3ZvZPxzZKuRuNmFnJWIOeZBOaSq60= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709919508; c=relaxed/simple; bh=d2DQ6qacq4v1kQEN4H9x+LMUf+t8SIRHRutikddN0wc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Hi3wTfSTnFUprtFtf8dDmeIB4fgy0thXk3jbEqpPRMHuffMMXhvp9ahWGSpUnX5kVuq3ucN0Xnmuno0PV1UpN84GA67frkk+09C7KDoV9xOrKtlEcOlqw8svJ4pIo8V2+zemUFxBJLZO8TKA5gbZgTJCNqHrLyeuIH1w2Asx0c4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709919505; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=6Buj4KlAXiBm7fMger0p48S38KV+Xia9jY8OpawI3RI=; b=KiTY3SrTscXlUY73fpEm1D+iyKMxq26t6qtaP855a3lNeXU93Wz3mC3o5md1HhlB6VJnZx a0Gy2+sJNok/ZZ2MvQpXptTT5r4hWSy/C2uCsIbJBIaTD72CP5hyf/RgPFXJLpbty6QuIG jNA5dGSCiLbOlrd7KadRwY+T5XIsAD0= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-557-kkvRiZxKN0WvZs8UAkv0lQ-1; Fri, 08 Mar 2024 12:38:24 -0500 X-MC-Unique: kkvRiZxKN0WvZs8UAkv0lQ-1 Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-7881a1ce399so131327085a.2 for ; Fri, 08 Mar 2024 09:38:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709919503; x=1710524303; h=mime-version:user-agent:message-id:date:organization:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6Buj4KlAXiBm7fMger0p48S38KV+Xia9jY8OpawI3RI=; b=CPl91PDUtKfqJj3GxoFRrfmn1DNNP29d0s33pnR3XIwpFSUwKgG5aOlm4ySrlKwzDW 8RzKzSvmFIkZwI3lg7iZsyQtNj5fDcWctekSmiCwc1O20o991MnxoflSYGBzibRy1GTe x3hohp8lKSKAR7o6CNSjfSXFxQogGipGO3pjpOrDJeTQ2aT7CnV9QyUTScWAsXwVg/5i GIJqNo87iEkp4vukfkjqe0pDDU3q6yBgcVXi646Kbn3hooChUvHtXlJj24cn/l0XKJ8m Of+Dt53rVtW2dkTRZLlyqL+B6HM2KkizQDqFrM/y/v0PvyJ/xrwC6DIlJfQhv2d8ZPKZ GrOg== X-Gm-Message-State: AOJu0Yy72j+yKv6DEcsO8A7CJ2lC4vPf1Lbzf3wzmnPDD1dSDj7+rNx7 NJCehtwNH37SVpgnMOtcprl33sq6FZjahXfEGueuHbtYpONhGTNa1ppEV83skxWaVVz7WL3cB3G lLNnP9qO51YWSDkAzsr+WiwuodlaHo3kqWhYxze+ChcrCY9/L5W1U5T9LvPIf7MD9ZYXoY/NRJ5 1vRAO/6V5MogBhY1EM37G0plKvje0KNMVx0kxd9g== X-Received: by 2002:a05:620a:5742:b0:788:50bd:36fe with SMTP id wj2-20020a05620a574200b0078850bd36femr3075069qkn.30.1709919503396; Fri, 08 Mar 2024 09:38:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IEEVVTAuKZ8NreHH1RzmpR7GDZVIGQWIpGJKsMKwwucmTmAGx+vguJ+EXnoKwqH8SHU34x0Xw== X-Received: by 2002:a05:620a:5742:b0:788:50bd:36fe with SMTP id wj2-20020a05620a574200b0078850bd36femr3075048qkn.30.1709919503051; Fri, 08 Mar 2024 09:38:23 -0800 (PST) Received: from localhost (88-120-130-27.subs.proxad.net. [88.120.130.27]) by smtp.gmail.com with ESMTPSA id c10-20020a37e10a000000b0078843dc545fsm2308006qkm.73.2024.03.08.09.38.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 09:38:22 -0800 (PST) Received: by localhost (Postfix, from userid 1000) id DBA3E5071022; Fri, 8 Mar 2024 18:38:20 +0100 (CET) From: Dodji Seketeli To: libabigail@sourceware.org Subject: [PATCH, applying to mainline] abidw: Add a -o short option for --out-file Organization: Red Hat / France X-Operating-System: AlmaLinux 9.3 X-URL: http://www.redhat.com Date: Fri, 08 Mar 2024 18:38:20 +0100 Message-ID: <87o7bo4oab.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_WEB, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Hello, This patch adds a shortcut -o shortcut option for the --out-file option of abidw. * doc/manuals/abidw.rst: Document the -o option. * tools/abidw.cc (display_usage): Update doc string for the --out-file|-o option. (parse_command): Support the -o short option. Signed-off-by: Dodji Seketeli --- doc/manuals/abidw.rst | 2 +- tools/abidw.cc | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/manuals/abidw.rst b/doc/manuals/abidw.rst index 1e308e66..13db912f 100644 --- a/doc/manuals/abidw.rst +++ b/doc/manuals/abidw.rst @@ -107,7 +107,7 @@ Options installed by your system's package manager because then ``abidw`` knows where to find it. - * ``--out-file`` <*file-path*> + * ``--out-file | -o`` <*file-path*> This option instructs ``abidw`` to emit the XML representation of *path-to-elf-file* into the file *file-path*, rather than emitting diff --git a/tools/abidw.cc b/tools/abidw.cc index c8a44dda..fe977b1d 100644 --- a/tools/abidw.cc +++ b/tools/abidw.cc @@ -208,7 +208,7 @@ display_usage(const string& prog_name, ostream& out) << " --debug-info-dir|-d look for debug info under 'dir-path'\n" << " --headers-dir|--hd the path to headers of the elf file\n" << " --header-file|--hf the path one header of the elf file\n" - << " --out-file write the output to 'file-path'\n" + << " --out-file|-o write the output to 'file-path'\n" << " --noout do not emit anything after reading the binary\n" << " --suppressions|--suppr specify a suppression file\n" << " --no-architecture do not emit architecture info in the output\n" @@ -331,7 +331,8 @@ parse_command_line(int argc, char* argv[], options& opts) opts.header_files.push_back(argv[j]); ++i; } - else if (!strcmp(argv[i], "--out-file")) + else if (!strcmp(argv[i], "--out-file") + || !strcmp(argv[i], "-o")) { if (argc <= i + 1 || argv[i + 1][0] == '-'