summaryrefslogtreecommitdiffstats
path: root/src/bin/dhcp4/main.cc
diff options
context:
space:
mode:
authorFrancis Dupont <fdupont@isc.org>2015-06-13 09:22:59 +0200
committerFrancis Dupont <fdupont@isc.org>2015-06-13 09:22:59 +0200
commit88bc04d8c5d66b804d7d71ad09a0b8af7c2f0918 (patch)
tree6781f0e96a1a21c400fb93ca9682a1dc1bb01f84 /src/bin/dhcp4/main.cc
parent[3513] Updated guides (diff)
downloadkea-88bc04d8c5d66b804d7d71ad09a0b8af7c2f0918.tar.xz
kea-88bc04d8c5d66b804d7d71ad09a0b8af7c2f0918.zip
[3513] Adopted standard order for usage (flags then options) and main (same with stricter alpha)
Diffstat (limited to 'src/bin/dhcp4/main.cc')
-rw-r--r--src/bin/dhcp4/main.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/bin/dhcp4/main.cc b/src/bin/dhcp4/main.cc
index d9a6c4fd3e..db8038d4f3 100644
--- a/src/bin/dhcp4/main.cc
+++ b/src/bin/dhcp4/main.cc
@@ -49,14 +49,14 @@ usage() {
cerr << "Kea DHCPv4 server, version " << VERSION << endl;
cerr << endl;
cerr << "Usage: " << DHCP4_NAME
- << " -[v|V|W] [-d] [-p number] [-c file]" << endl;
- cerr << " -c file: specify configuration file" << endl;
- cerr << " -d: debug mode with extra verbosity (former -v)" << endl;
- cerr << " -p number: specify non-standard port number 1-65535 "
- << "(useful for testing only)" << endl;
+ << " -[v|V|W] [-d] [-c file] [-p number]" << endl;
cerr << " -v: print version number and exit" << endl;
cerr << " -V: print extended version and exit" << endl;
cerr << " -W: display the configuration report and exit" << endl;
+ cerr << " -d: debug mode with extra verbosity (former -v)" << endl;
+ cerr << " -c file: specify configuration file" << endl;
+ cerr << " -p number: specify non-standard port number 1-65535 "
+ << "(useful for testing only)" << endl;
exit(EXIT_FAILURE);
}
} // end of anonymous namespace
@@ -71,7 +71,7 @@ main(int argc, char* argv[]) {
// The standard config file
std::string config_file("");
- while ((ch = getopt(argc, argv, "dvVWp:c:")) != -1) {
+ while ((ch = getopt(argc, argv, "dvVWc:p:")) != -1) {
switch (ch) {
case 'd':
verbose_mode = true;
@@ -89,6 +89,10 @@ main(int argc, char* argv[]) {
cout << isc::detail::getConfigReport() << endl;
return (EXIT_SUCCESS);
+ case 'c': // config file
+ config_file = optarg;
+ break;
+
case 'p':
try {
port_number = boost::lexical_cast<int>(optarg);
@@ -104,10 +108,6 @@ main(int argc, char* argv[]) {
}
break;
- case 'c': // config file
- config_file = optarg;
- break;
-
default:
usage();
}