From patchwork Fri Nov 5 09:17:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tangmeng X-Patchwork-Id: 47096 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 2A1143857C7B for ; Fri, 5 Nov 2021 09:17:44 +0000 (GMT) X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from smtpbgau1.qq.com (smtpbgau1.qq.com [54.206.16.166]) by sourceware.org (Postfix) with ESMTPS id 94ABA3858D35 for ; Fri, 5 Nov 2021 09:17:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 94ABA3858D35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=uniontech.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=uniontech.com X-QQ-mid: bizesmtp33t1636103847tjy4xns6 Received: from localhost.localdomain (unknown [58.240.82.166]) by esmtp6.qq.com (ESMTP) with id ; Fri, 05 Nov 2021 17:17:21 +0800 (CST) X-QQ-SSF: 0140000000200040C000000A0000000 X-QQ-FEAT: FCUjxTjsuSJCGyu1boDoIjoYM18vBZrYjqk2IigmU19FJ0pf4X5p4PN4hvV1D UpjwuJKjTwLslwv1imc+YhoO0ikwA0qKl2p/khM6XFtZbU/OoO50031ibDHvQjgoYLBrDVc Igc5KECHYZcw5VuMtUKRw5+0DEsccmoBDYAnIfQ8AhA8Y6Ycn/nFfEgQSuQZY7LfgoPXl2B HVl/Qy382HZ7vvYdBlIavmANWhRHl+KPKKqCEgf9TjiyRbXRJ7BhrsXw2qpn/vkFVwCdiBX A1nsOIPqmtrUXuTnXxsIPp5g0ur9jUh8o5DCP+Dmd93juIk4ix99d50VBsf+nPqqmK074g/ Yhw/psoWqA2rYqGHAylrnVZtGPJRciQzCUp/zOM X-QQ-GoodBg: 2 From: tangmeng To: libabigail@sourceware.org Subject: [PATCH] abilint: Add prompt message for abnormal operation Date: Fri, 5 Nov 2021 17:17:18 +0800 Message-Id: <20211105091718.13221-1-tangmeng@uniontech.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:uniontech.com:qybgforeign:qybgforeign2 X-QQ-Bgrelay: 1 X-Spam-Status: No, score=-13.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , Cc: tangmeng Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libabigail" When using abilint, if the uses the --stdin option and also provides a file path on the command line, the file path is silently ignored. This patch provides a warning to notify the user that the file path is ignored in that case. * tools/abilint.cc (parse_command_line): Notify the user when the path to the file is ignored because the --stdin option was provided. Signed-off-by: tangmeng --- tools/abilint.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/abilint.cc b/tools/abilint.cc index 88cf4589..ebf14a71 100644 --- a/tools/abilint.cc +++ b/tools/abilint.cc @@ -205,6 +205,14 @@ parse_command_line(int argc, char* argv[], options& opts) if (opts.file_path.empty()) opts.read_from_stdin = true; + + if (opts.read_from_stdin && !opts.file_path.empty()) + { + emit_prefix(argv[0], cout) + << "WARNING: The \'--stdin\' option is used. The " + << opts.file_path << " will be ignored automatically\n"; + } + return true; }