summaryrefslogtreecommitdiff
path: root/tools/llvm-rc/llvm-rc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/llvm-rc/llvm-rc.cpp')
-rw-r--r--tools/llvm-rc/llvm-rc.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/llvm-rc/llvm-rc.cpp b/tools/llvm-rc/llvm-rc.cpp
index 0448f4519b4c..54997e900a23 100644
--- a/tools/llvm-rc/llvm-rc.cpp
+++ b/tools/llvm-rc/llvm-rc.cpp
@@ -31,6 +31,7 @@
#include "llvm/Support/Signals.h"
#include "llvm/Support/raw_ostream.h"
+#include <algorithm>
#include <system_error>
using namespace llvm;
@@ -85,18 +86,23 @@ int main(int Argc, const char **Argv) {
RcOptTable T;
unsigned MAI, MAC;
- ArrayRef<const char *> ArgsArr = makeArrayRef(Argv + 1, Argc - 1);
+ const char **DashDash = std::find_if(
+ Argv + 1, Argv + Argc, [](StringRef Str) { return Str == "--"; });
+ ArrayRef<const char *> ArgsArr = makeArrayRef(Argv + 1, DashDash);
+
opt::InputArgList InputArgs = T.ParseArgs(ArgsArr, MAI, MAC);
// The tool prints nothing when invoked with no command-line arguments.
if (InputArgs.hasArg(OPT_HELP)) {
- T.PrintHelp(outs(), "rc", "Resource Converter", false);
+ T.PrintHelp(outs(), "rc [options] file...", "Resource Converter", false);
return 0;
}
const bool BeVerbose = InputArgs.hasArg(OPT_VERBOSE);
std::vector<std::string> InArgsInfo = InputArgs.getAllArgValues(OPT_INPUT);
+ if (DashDash != Argv + Argc)
+ InArgsInfo.insert(InArgsInfo.end(), DashDash + 1, Argv + Argc);
if (InArgsInfo.size() != 1) {
fatalError("Exactly one input file should be provided.");
}