diff options
author | Chris Lattner <sabre@nondot.org> | 2001-10-13 06:53:19 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2001-10-13 06:53:19 +0000 |
commit | d215fd1f5610033fbe704c975805790530262d26 (patch) | |
tree | 0691a29295bca91484a061b90676cbe510fc9c37 | |
parent | 93d39d23b4775e756aec453d3a92ca334f91424c (diff) | |
download | external_llvm-d215fd1f5610033fbe704c975805790530262d26.zip external_llvm-d215fd1f5610033fbe704c975805790530262d26.tar.gz external_llvm-d215fd1f5610033fbe704c975805790530262d26.tar.bz2 |
Add StringList support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@766 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Support/CommandLine.cpp | 11 | ||||
-rw-r--r-- | 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 0584590..76d9e36 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; @@ -212,6 +213,14 @@ bool String::handleOccurance(const char *ArgName, const string &Arg) { } //===----------------------------------------------------------------------===// +// 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 // void EnumBase::processValues(va_list Vals) { diff --git a/support/lib/Support/CommandLine.cpp b/support/lib/Support/CommandLine.cpp index 0584590..76d9e36 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; @@ -212,6 +213,14 @@ bool String::handleOccurance(const char *ArgName, const string &Arg) { } //===----------------------------------------------------------------------===// +// 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 // void EnumBase::processValues(va_list Vals) { |