[PATCH] D22621: [llvm-cov] - Improve llvm-cov error message

Ying Yi via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 21 03:27:03 PDT 2016


MaggieYi created this revision.
MaggieYi added reviewers: vsk, davidxl.
MaggieYi added a subscriber: llvm-commits.

When giving the following command:
% llvm-cov report -instr-profile=default.profraw

llvm-cov will give the following error message:

>llvm-cov report: Not enough positional command line arguments specified! 
>Must specify at least 1 positional arguments: See: orbis-llvm-cov report –help

This patch changes the error message from  “1 positional arguments” to “1 positional argument”.


https://reviews.llvm.org/D22621

Files:
  lib/Support/CommandLine.cpp
  test/tools/llvm-cov/universal-binary.c

Index: test/tools/llvm-cov/universal-binary.c
===================================================================
--- test/tools/llvm-cov/universal-binary.c
+++ test/tools/llvm-cov/universal-binary.c
@@ -8,3 +8,6 @@
 
 // RUN: not llvm-cov show %S/Inputs/universal-binary -instr-profile %t.profdata -filename-equivalence %s -arch i386 2>&1 | FileCheck --check-prefix=WRONG-ARCH %s
 // WRONG-ARCH: Failed to load coverage
+
+// RUN: not llvm-cov report -instr-profile %t.profdata 2>&1 | FileCheck --check-prefix=MISSING-BINARY %s
+// MISSING-BINARY: 1 positional argument: See:
Index: lib/Support/CommandLine.cpp
===================================================================
--- lib/Support/CommandLine.cpp
+++ lib/Support/CommandLine.cpp
@@ -1211,7 +1211,8 @@
       errs() << ProgramName
              << ": Not enough positional command line arguments specified!\n"
              << "Must specify at least " << NumPositionalRequired
-             << " positional arguments: See: " << argv[0] << " -help\n";
+             << " positional argument" << (NumPositionalRequired > 1 ? "s" : "")
+             << ": See: " << argv[0] << " - help\n";
     }
 
     ErrorParsing = true;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22621.64851.patch
Type: text/x-patch
Size: 1186 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160721/83f5b136/attachment.bin>


More information about the llvm-commits mailing list