From d215fd1f5610033fbe704c975805790530262d26 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 13 Oct 2001 06:53:19 +0000 Subject: [PATCH] Add StringList support git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@766 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/CommandLine.cpp | 11 ++++++++++- support/lib/Support/CommandLine.cpp | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/lib/Support/CommandLine.cpp b/lib/Support/CommandLine.cpp index 05845906887..76d9e3690a7 100644 --- a/lib/Support/CommandLine.cpp +++ b/lib/Support/CommandLine.cpp @@ -185,7 +185,8 @@ bool Flag::handleOccurance(const char *ArgName, const string &Arg) { } else if (Arg == "false" || Arg == "FALSE" || Arg == "False" || Arg == "0") { Value = false; } else { - return error(": '" + Arg + "' is invalid value for boolean argument! Try 0 or 1"); + return error(": '" + Arg + + "' is invalid value for boolean argument! Try 0 or 1"); } return false; @@ -211,6 +212,14 @@ bool String::handleOccurance(const char *ArgName, const string &Arg) { return false; } +//===----------------------------------------------------------------------===// +// StringList valued command line option implementation +// +bool StringList::handleOccurance(const char *ArgName, const string &Arg) { + Values.push_back(Arg); + return false; +} + //===----------------------------------------------------------------------===// // Enum valued command line option implementation // diff --git a/support/lib/Support/CommandLine.cpp b/support/lib/Support/CommandLine.cpp index 05845906887..76d9e3690a7 100644 --- a/support/lib/Support/CommandLine.cpp +++ b/support/lib/Support/CommandLine.cpp @@ -185,7 +185,8 @@ bool Flag::handleOccurance(const char *ArgName, const string &Arg) { } else if (Arg == "false" || Arg == "FALSE" || Arg == "False" || Arg == "0") { Value = false; } else { - return error(": '" + Arg + "' is invalid value for boolean argument! Try 0 or 1"); + return error(": '" + Arg + + "' is invalid value for boolean argument! Try 0 or 1"); } return false; @@ -211,6 +212,14 @@ bool String::handleOccurance(const char *ArgName, const string &Arg) { return false; } +//===----------------------------------------------------------------------===// +// StringList valued command line option implementation +// +bool StringList::handleOccurance(const char *ArgName, const string &Arg) { + Values.push_back(Arg); + return false; +} + //===----------------------------------------------------------------------===// // Enum valued command line option implementation //