From fb310f588a1bc351d4e592a65f92887571f616de Mon Sep 17 00:00:00 2001 From: Enrico Jorns Date: Fri, 5 Aug 2016 15:26:03 +0200 Subject: 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 Tested-by: Bastian Stender --- src/barebox-state.c | 6 ++++++ 1 file changed, 6 insertions(+) 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; + } } -- cgit v1.2.3