@@ -125,6 +125,7 @@ int main(int argc, char **argv)
125
125
{
126
126
int result ;
127
127
int error = FALSE;
128
+ int display_version = FALSE;
128
129
int display_license = FALSE;
129
130
int display_help = FALSE;
130
131
int c = 0 ;
@@ -161,7 +162,7 @@ int main(int argc, char **argv)
161
162
162
163
/* get all command line arguments */
163
164
while (1 ) {
164
- c = getopt (argc , argv , "+hVvdspuxTW " );
165
+ c = getopt (argc , argv , "+hLVvdspuxTW " );
165
166
166
167
if (c == -1 || c == EOF )
167
168
break ;
@@ -174,6 +175,10 @@ int main(int argc, char **argv)
174
175
break ;
175
176
176
177
case 'V' : /* version */
178
+ display_version = TRUE;
179
+ break ;
180
+
181
+ case 'L' : /* license */
177
182
display_license = TRUE;
178
183
break ;
179
184
@@ -238,17 +243,18 @@ int main(int argc, char **argv)
238
243
exit (nm_core_worker (worker_socket ));
239
244
}
240
245
241
- if (daemon_mode == FALSE) {
242
- printf ("\nNaemon Core " VERSION "\n" );
246
+ if (display_version == TRUE) {
247
+ printf ("Naemon Core " VERSION "\n" );
248
+
249
+ exit (OK );
250
+ }
251
+
252
+ if (display_license == TRUE) {
243
253
printf ("Copyright (c) 2013-present Naemon Core Development Team and Community Contributors\n" );
244
254
printf ("Copyright (c) 2009-2013 Nagios Core Development Team and Community Contributors\n" );
245
255
printf ("Copyright (c) 1999-2009 Ethan Galstad\n" );
246
- printf ("License: GPL \n\n" );
256
+ printf ("License: GPLv2 \n\n" );
247
257
printf ("Website: https://www.naemon.io\n" );
248
- }
249
-
250
- /* just display the license */
251
- if (display_license == TRUE) {
252
258
253
259
printf ("This program is free software; you can redistribute it and/or modify\n" );
254
260
printf ("it under the terms of the GNU General Public License version 2 as\n" );
0 commit comments