Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
config: upgrade dbg to err on missing option
A user has pointed out that west's behavior in the following case is confusing: west config foo.bar=baz The desired behavior is "set foo.bar to baz". Instead, west exits 1 without printing anything on the console. Let's make it clearer that the user is inadventently asking for the value of an option called "foo.bar=baz", since right now there is no rule forbidding "=" in option names, so the above confusing case is actually asking for section "foo", key "bar=baz". With this patch, west prints: ERROR: foo.bar=baz is unset to stderr along with exiting 1, making it clearer that something went wrong. Note that since this doesn't print to stdout, the new output won't be confused with the value of the option by well-behaved programs. In general, 'west config' documents no guarantees about when it prints to stderr, and new error messages showing up on stderr is in line with general de facto standard expectations for command line programs. However, users may need to redirect stderr to /dev/null (or do similarly on Windows) now if they aren't interested in this output. Reported-by: David Brown <[email protected]> Signed-off-by: Martí Bolívar <[email protected]>
- Loading branch information