If you're asking about documentation on general flag handling in Chromium OS code, that can be found in the
libchromeos dev page as well as in the
source header comments. For update_engine_client documentation, some of it can be found
here.
The original PSA I sent about flag handling can be viewed
here.
Basically, the libchromeos flag library is based off the Chromium base/command_line.h parser, which only parses into boolean and string types. It treats anything prepended with "-" or "--" as a flag and everything else as an argument. It doesn't have any pre-knowledge of each flag's type, so thus with space-delimited flags it can't tell the difference between "--string_flag string_value" and "--boolean_flag argument". While we could use the libchromeos flag handling knowledge of expected flag types to support space-delimited key-value pairs, doing such would require basically writing a second pre-parser within the library to support this. While feasible and not too difficult to implement, the additional runtime hit and code complexity of double parsing wasn't worth the convenience of having space-delimited pairs, so we decided leave that feature out and just go with the convention of '='-delimited flags.
As far as handling invalid input, the libchromeos flag handling library does know about flag types, and converts the base/command_line.h parsed string flags into corresponding int, int64, uint64, and double types as necessary, and will indeed throw immediate errors with what should be obvious messages if the input format is invalid. However it will not throw any "invalid input" errors when an expected string argument (such as the --channel flag) gets an empty string passed to it, as that is a valid use case that some other programs want when they have default values for some flags and want it to instead be an empty string. Empty string validation would have to occur within the program itself, in this case within update_engine_client code if an empty channel string is indeed always considered an error.