Display version on start and allow --version to work

This commit is contained in:
Roy Marples 2007-11-19 16:41:36 +00:00
parent eb20d7d786
commit 81715c3159
3 changed files with 19 additions and 2 deletions

View File

@ -30,6 +30,9 @@
* SUCH DAMAGE.
*/
const char copyright[] = "Copyright (c) 2007 Gentoo Foundation\n"
"Copyright (c) 2007 Roy Marples";
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/stat.h>

View File

@ -30,6 +30,9 @@
* SUCH DAMAGE.
*/
const char copyright[] = "Copyright (c) 2007 Gentoo Foundation\n"
"Copyright (c) 2007 Roy Marples";
#include "librc.h"
/* usecs to wait while we poll the fifo */

View File

@ -35,6 +35,9 @@
* SUCH DAMAGE.
*/
const char copyright[] = "Copyright (c) 2007 Gentoo Foundation\n"
"Copyright (c) 2007 Roy Marples";
#define APPLET "rc"
#define SYSLOG_NAMES
@ -68,6 +71,8 @@
#include "rc-plugin.h"
#include "strlist.h"
#include "version.h"
#define INITSH RC_LIBDIR "/sh/init.sh"
#define INITEARLYSH RC_LIBDIR "/sh/init-early.sh"
#define HALTSH RC_INITDIR "/halt.sh"
@ -796,6 +801,11 @@ int main (int argc, char **argv)
if (! applet)
eerrorx ("arguments required");
if (argc > 1 && (strcmp (argv[1], "--version") == 0)) {
printf ("%s (Open RC) version " VERSION "\n", applet);
exit (EXIT_SUCCESS);
}
/* These used to be programs in their own right, so we shouldn't
* touch argc or argv for them */
if (strcmp (applet, "fstabinfo") == 0)
@ -968,8 +978,9 @@ int main (int argc, char **argv)
run_script (INITEARLYSH);
uname (&uts);
printf (" %sOpenRC%s is starting up\n",
ecolor (ECOLOR_GOOD), ecolor (ECOLOR_NORMAL));
printf (" %sOpenRC %s" VERSION "%s is starting up\n",
ecolor (ECOLOR_GOOD), ecolor (ECOLOR_BRACKET),
ecolor (ECOLOR_NORMAL));
if (rc_env_bool ("RC_INTERACTIVE"))
printf ("Press %sI%s to enter interactive boot mode\n\n",