public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: tangmeng <tangmeng@uniontech.com>
To: libabigail@sourceware.org
Cc: tangmeng <tangmeng@uniontech.com>
Subject: [PATCH] abilint: Add prompt message for abnormal operation
Date: Fri,  5 Nov 2021 17:17:18 +0800	[thread overview]
Message-ID: <20211105091718.13221-1-tangmeng@uniontech.com> (raw)

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 <tangmeng@uniontech.com>
---
 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;
 }
 
-- 
2.20.1




             reply	other threads:[~2021-11-05  9:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-05  9:17 tangmeng [this message]
2021-11-09 10:00 ` Dodji Seketeli

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=20211105091718.13221-1-tangmeng@uniontech.com \
    --to=tangmeng@uniontech.com \
    --cc=libabigail@sourceware.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).