diff options
author | Chris Lattner <sabre@nondot.org> | 2001-10-24 06:21:56 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2001-10-24 06:21:56 +0000 |
commit | f038acbee21cfed998451aedd00a81901d299516 (patch) | |
tree | 4553238d2cceda9550895eb31abd89fbba4e6519 /lib/Support | |
parent | 7eadfa1db8d463576470afa9d98ae7fec65aa9ec (diff) | |
download | external_llvm-f038acbee21cfed998451aedd00a81901d299516.zip external_llvm-f038acbee21cfed998451aedd00a81901d299516.tar.gz external_llvm-f038acbee21cfed998451aedd00a81901d299516.tar.bz2 |
Clean up error handling a bit. Add / as a seperator for command line arguments. This is just a big old ugly hack.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@974 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support')
-rw-r--r-- | lib/Support/CommandLine.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Support/CommandLine.cpp b/lib/Support/CommandLine.cpp index 76d9e36..07220a6 100644 --- a/lib/Support/CommandLine.cpp +++ b/lib/Support/CommandLine.cpp @@ -57,7 +57,8 @@ void cl::ParseCommandLineOptions(int &argc, char **argv, while (*ArgName == '-') ++ArgName; // Eat leading dashes const char *ArgNameEnd = ArgName; - while (*ArgNameEnd && *ArgNameEnd != '=') ++ArgNameEnd; // Scan till end + while (*ArgNameEnd && *ArgNameEnd != '=' && + *ArgNameEnd != '/') ++ArgNameEnd; // Scan till end Value = ArgNameEnd; if (*Value) // If we have an equals sign... @@ -72,7 +73,7 @@ void cl::ParseCommandLineOptions(int &argc, char **argv, if (Handler == 0) { cerr << "Unknown command line argument '" << argv[i] << "'. Try: " - << argv[0] << " --help\n'"; + << argv[0] << " --help'\n"; ErrorParsing = true; continue; } @@ -111,8 +112,10 @@ void cl::ParseCommandLineOptions(int &argc, char **argv, switch (I->second->getNumOccurancesFlag()) { case Required: case OneOrMore: - if (I->second->getNumOccurances() == 0) + if (I->second->getNumOccurances() == 0) { I->second->error(" must be specified at least once!"); + ErrorParsing = true; + } // Fall through default: break; |