diff options
author | Enrico Jorns <ejo@pengutronix.de> | 2016-08-05 15:26:03 +0200 |
---|---|---|
committer | Bastian Stender <bst@pengutronix.de> | 2016-08-08 14:32:59 +0200 |
commit | fb310f588a1bc351d4e592a65f92887571f616de (patch) | |
tree | 9c75bfeaa414a5a3cb476470b5a6261e789d3242 | |
parent | bb064d385861f480520149f551c99257882c2bc0 (diff) | |
download | dt-utils-fb310f588a1bc351d4e592a65f92887571f616de.tar.gz dt-utils-fb310f588a1bc351d4e592a65f92887571f616de.tar.xz |
barebox-state: return non-zero exit code for missing or invalid arg
This make barebox-state return non-zero exit-code in case of a missing
parameter (':') or an invalid/unknown argument ('?').
No extra printing of error messages is performed as this is handled by
getopt itself in this configuration.
Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
Tested-by: Bastian Stender <bst@pengutronix.de>
-rw-r--r-- | src/barebox-state.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/barebox-state.c b/src/barebox-state.c index 23b7e97..e0902ab 100644 --- a/src/barebox-state.c +++ b/src/barebox-state.c @@ -475,6 +475,12 @@ int main(int argc, char *argv[]) ++nr_states; break; } + case ':': + case '?': + default: + exit(1); + break; + } } |