fix required arguments check for write -h
This commit is contained in:
@@ -1001,12 +1001,14 @@ result_t MainLoop::executeWrite(const vector<string>& args, const string levels,
|
|||||||
argPos++;
|
argPos++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((hex && (newDefinition || dstAddress != SYN || !circuit.empty() || args.size() < argPos + 1))
|
if ((args.size() < argPos + 1)
|
||||||
|| (newDefinition && (hex || !circuit.empty() || args.size() < argPos + 1 || args.size() > argPos + 2))) {
|
|| (hex && (newDefinition || dstAddress != SYN))
|
||||||
|
|| (newDefinition && (hex || !circuit.empty() || args.size() > argPos + 2))
|
||||||
|
|| (!newDefinition && !hex && (circuit.empty() || args.size() > argPos + 2))) {
|
||||||
argPos = 0; // print usage
|
argPos = 0; // print usage
|
||||||
}
|
}
|
||||||
|
|
||||||
if (argPos == 0 || (!newDefinition && (circuit.empty() || (args.size() != argPos+2 && args.size() != argPos+1)))) {
|
if (argPos == 0) {
|
||||||
*ostream << "usage: write [-s QQ] [-d ZZ] -c CIRCUIT NAME [VALUE[;VALUE]*]\n"
|
*ostream << "usage: write [-s QQ] [-d ZZ] -c CIRCUIT NAME [VALUE[;VALUE]*]\n"
|
||||||
" or: write [-s QQ] [-d ZZ] -def DEFINITION [VALUE[;VALUE]*] (only if enabled)\n"
|
" or: write [-s QQ] [-d ZZ] -def DEFINITION [VALUE[;VALUE]*] (only if enabled)\n"
|
||||||
" or: write [-s QQ] [-c CIRCUIT] -h ZZPBSBNN[DD]*\n"
|
" or: write [-s QQ] [-c CIRCUIT] -h ZZPBSBNN[DD]*\n"
|
||||||
|
|||||||
Reference in New Issue
Block a user