mirror of
https://github.com/OpenNebula/one.git
synced 2024-12-23 17:33:56 +03:00
Lint help and usage in oned.cc
This commit is contained in:
parent
efcccabd5e
commit
d9b6cca195
@ -19,28 +19,12 @@
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <time.h>
|
||||
#include <ostream>
|
||||
|
||||
#include "Nebula.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
/* GLOBAL VARIABLES */
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
static const char * usage =
|
||||
"\n oned [-h] [-v] [-f]\n\n"
|
||||
"SYNOPSIS\n"
|
||||
" Starts the OpenNebula daemon\n\n"
|
||||
"OPTIONS\n"
|
||||
"\t-v\tprints OpenNebula version and license\n"
|
||||
"\t-h\tprints this help.\n"
|
||||
"\t-f\tforeground, do not fork the oned daemon\n"
|
||||
"\t-i\tinitialize the dabase and exit.\n";
|
||||
|
||||
static const char * susage =
|
||||
"usage: oned [-h] [-v] [-f]\n";
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
@ -57,6 +41,25 @@ static void print_version()
|
||||
<< "(http://www.apache.org/licenses/LICENSE-2.0).\n";
|
||||
}
|
||||
|
||||
static void print_usage(ostream& str)
|
||||
{
|
||||
str << "Usage: oned [-h] [-v] [-f] [-i]\n";
|
||||
}
|
||||
|
||||
static void print_help()
|
||||
{
|
||||
print_usage(cout);
|
||||
|
||||
cout << "\n"
|
||||
<< "SYNOPSIS\n"
|
||||
<< " Starts the OpenNebula daemon\n\n"
|
||||
<< "OPTIONS\n"
|
||||
<< " -v\toutput version information and exit\n"
|
||||
<< " -h\tdisplay this help and exit\n"
|
||||
<< " -f\tforeground, do not fork the oned daemon\n"
|
||||
<< " -i\tinitialize the dabase and exit\n";
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
@ -114,7 +117,7 @@ int main(int argc, char **argv)
|
||||
exit(0);
|
||||
break;
|
||||
case 'h':
|
||||
cout << usage;
|
||||
print_help();
|
||||
exit(0);
|
||||
break;
|
||||
case 'i':
|
||||
@ -125,7 +128,7 @@ int main(int argc, char **argv)
|
||||
foreground = true;
|
||||
break;
|
||||
default:
|
||||
cerr << susage;
|
||||
print_usage(cerr);
|
||||
exit(-1);
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user