mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
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
This commit is contained in:
parent
7eadfa1db8
commit
f038acbee2
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user