# HG changeset patch # User František Kučera # Date 1532868170 -7200 # Node ID f543468a7e4975622e0b9a979709371f0c01937e # Parent 70af169464664806765fa76ab8eb5653fc3e581f StdInCommand: throw exception if required value is missing diff -r 70af16946466 -r f543468a7e49 StdInCommand.h --- a/StdInCommand.h Sat Jul 28 22:29:40 2018 +0200 +++ b/StdInCommand.h Sun Jul 29 14:42:50 2018 +0200 @@ -48,6 +48,8 @@ if (ch == 0 || input.eof() || input.fail()) break; else value << ch; } + + if (required && value.str().empty()) throw RelpipeCLIException(L"Missing value on STDIN.", CLI::EXIT_CODE_BAD_SYNTAX); return convertor.from_bytes(value.str()); } @@ -80,6 +82,7 @@ string_t value = readNext(input, arguments, i, false); if (value.empty() && (input.eof() || input.fail())) break; else writer->writeAttribute(value); + // TODO: check attribute count (avoid unfinished records) } } };