Hi,
On 11.01.2018 08:30, R. Diez wrote:
I'm not sure about failing (i.e. returning an error code), though. Technically, not writing anything when no --image arguments are given seems correct.
If you are calling flashrom, surely you do not expect it to be a "no operation" that should just succeed. That is counterintuitive. We end-users are not logic-driven mathematicians!
yes, you are! Logic follows the same patterns as intuitively developed languages. Somebody who can read and write English as good as you is a logic-driven mathematician. That people tend to object is mostly due to the weird ways they try to teach you "logic" in school (which usually feels wrong because it's not following the way you already intuitively learned it). Anyway, please ignore the above, it's OT on this list.
At the very least you should change the wording from "Warning: Chip content is identical to the requested image." and "Erase/write done." to "no operation specified", "nothing to do" or something similar.
I've already agreed to update the message. Patches are welcome.
I personally would return an error code too.
Error codes are usually only checked by other programs / scripts. Not following basic logic at such an interface makes software overall more complex and error-prone, IMHO.
The help text should also say that "--layout" requires at least one --image. Or at least mention that, without at least one --image argument, it becomes a noop.
Right, patches are welcome.
Nico