Changes: Moved printing the applauncherd usage from Daemon class to main()

RevBy: Olli Leppänen
pull/1/head
Oskari Timperi 16 years ago
parent e72d9ee523
commit cca1281165

@ -352,33 +352,11 @@ void Daemon::daemonize()
}
}
void Daemon::usage() const
{
std::cout << "Usage: "<< PROG_NAME << " [options]\n"
<< "\n"
<< "Options:\n"
<< " --daemon Fork and go into the background.\n"
//<< " --pidfile FILE Specify a different pid file (default " << LAUNCHER_PIDFILE << " ).\n"
//<< " --send-app-died Send application died signal.\n"
<< " --quiet Do not print anything.\n"
<< " --help Print this help message.\n"
<< "\n"
<< "Use the invoker to start a <shared object> from the launcher.\n"
<< "Where <shared object> is a binary including a 'main' symbol.\n"
<< "Note that the binary needs to be linked with -shared or -pie.\n";
exit(EXIT_SUCCESS);
}
void Daemon::parseArgs(const ArgVect & args)
{
for (ArgVect::const_iterator i(args.begin()); i != args.end(); i++)
{
if ((*i) == "--help")
{
usage();
}
else if ((*i) == "--daemon")
if ((*i) == "--daemon")
{
m_daemon = true;
}

@ -91,9 +91,6 @@ private:
//! Fork to a daemon
void daemonize();
//! Print usage
void usage() const;
//! Forks and initializes a new Booster
bool forkBooster(char type, int pipefd[2]);

@ -20,6 +20,7 @@
#include "daemon.h"
#include "logger.h"
#include <iostream>
#include <cstdlib>
#include <signal.h>
#include <fcntl.h>
@ -43,9 +44,36 @@ void exitLauncher(int)
exit(0);
}
void usage()
{
std::cout << "Usage: "<< PROG_NAME << " [options]\n"
<< "\n"
<< "Options:\n"
<< " --daemon Fork and go into the background.\n"
//<< " --pidfile FILE Specify a different pid file (default " << LAUNCHER_PIDFILE << " ).\n"
//<< " --send-app-died Send application died signal.\n"
<< " --quiet Do not print anything.\n"
<< " --help Print this help message.\n"
<< "\n"
<< "Use the invoker to start a <shared object> from the launcher.\n"
<< "Where <shared object> is a binary including a 'main' symbol.\n"
<< "Note that the binary needs to be linked with -shared or -pie.\n";
exit(EXIT_SUCCESS);
}
//! Main function
int main(int argc, char * argv[])
{
// Print usage if requested on commandline
for (int i = 1; i < argc; ++i)
{
if (std::string(argv[i]) == "--help")
{
usage();
}
}
// Open the log
Logger::openLog(PROG_NAME);
Logger::logNotice("%s starting..", PROG_NAME);

Loading…
Cancel
Save