From 73d1a8698e101b1dcf589b27b35ac9b09ea6d02c Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Sat, 12 Feb 2011 19:15:29 -0600 Subject: make version option common This reworks the code for the version option so that it is part of the parser loop and is a common option to all applets. --- src/rc/rc.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'src/rc/rc.c') diff --git a/src/rc/rc.c b/src/rc/rc.c index bdda2ef..525ccdc 100644 --- a/src/rc/rc.c +++ b/src/rc/rc.c @@ -837,18 +837,6 @@ main(int argc, char **argv) if (!applet) eerrorx("arguments required"); - if (argc > 1 && (strcmp(argv[1], "--version") == 0)) { - printf("%s (OpenRC", applet); - if ((bootlevel = rc_sys())) - printf(" [%s]", bootlevel); - printf(") " VERSION -#ifdef BRANDING - " (" BRANDING ")" -#endif - "\n"); - exit(EXIT_SUCCESS); - } - /* Run our built in applets. If we ran one, we don't return. */ run_applets(argc, argv); @@ -905,8 +893,8 @@ main(int argc, char **argv) } exit(EXIT_SUCCESS); /* NOTREACHED */ - case_RC_COMMON_GETOPT - } + case_RC_COMMON_GETOPT + } } newlevel = argv[optind++]; -- cgit v1.2.3