Change in osmo-bsc[master]: osmo-bsc main: exit on cmdline option error

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

neels gerrit-no-reply at lists.osmocom.org
Fri Jun 12 15:35:00 UTC 2020


neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/18797 )


Change subject: osmo-bsc main: exit on cmdline option error
......................................................................

osmo-bsc main: exit on cmdline option error

Change-Id: I7c3432790a77ae9081d2c458ee9f598e435e089d
---
M src/osmo-bsc/osmo_bsc_main.c
1 file changed, 3 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/97/18797/1

diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c
index 0e5b4e6..9eaaf2a 100644
--- a/src/osmo-bsc/osmo_bsc_main.c
+++ b/src/osmo-bsc/osmo_bsc_main.c
@@ -173,8 +173,9 @@
 			rf_ctrl = optarg;
 			break;
 		default:
-			/* ignore */
-			break;
+			/* catch unknown options *as well as* missing arguments. */
+			fprintf(stderr, "Error in command line options. Exiting.\n");
+			exit(-1);
 		}
 	}
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/18797
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I7c3432790a77ae9081d2c458ee9f598e435e089d
Gerrit-Change-Number: 18797
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200612/e1f292ee/attachment.htm>


More information about the gerrit-log mailing list