Commit c6727e5b authored by Francis Dupont's avatar Francis Dupont

[3882a] Extended -V and added -W

parent 7edc41b8
......@@ -20,7 +20,7 @@
<refentry>
<refentryinfo>
<date>Feb 1, 2015</date>
<date>June 20, 2015</date>
</refentryinfo>
<refmeta>
......@@ -53,6 +53,7 @@
<arg><option>-f <replaceable class="parameter">finish-file</replaceable></option></arg>
<arg><option>-v</option></arg>
<arg><option>-V</option></arg>
<arg><option>-W</option></arg>
<arg><option>-d</option></arg>
<arg><option>-h</option></arg>
</cmdsynopsis>
......@@ -99,6 +100,13 @@
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-W</option></term>
<listitem><para>
Display the configuration report.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-h</option></term>
<listitem><para>
......
......@@ -20,6 +20,7 @@
#include <exceptions/exceptions.h>
#include <dhcpsrv/csv_lease_file4.h>
#include <dhcpsrv/csv_lease_file6.h>
#include <dhcpsrv/memfile_lease_mgr.h>
#include <dhcpsrv/memfile_lease_storage.h>
#include <dhcpsrv/lease_mgr.h>
#include <dhcpsrv/lease_file_loader.h>
......@@ -157,7 +158,7 @@ LFCController::parseArgs(int argc, char* argv[]) {
opterr = 0;
optind = 1;
while ((ch = getopt(argc, argv, ":46dvVp:x:i:o:c:f:")) != -1) {
while ((ch = getopt(argc, argv, ":46dvVWp:x:i:o:c:f:")) != -1) {
switch (ch) {
case '4':
// Process DHCPv4 lease files.
......@@ -179,6 +180,11 @@ LFCController::parseArgs(int argc, char* argv[]) {
std::cout << getVersion(true) << std::endl;
exit(EXIT_SUCCESS);
case 'W':
// Display the configuration report and exit.
std::cout << isc::detail::getConfigReport() << std::endl;
exit(EXIT_SUCCESS);
case 'd':
// Verbose output.
verbose_ = true;
......@@ -325,7 +331,8 @@ LFCController::getVersion(const bool extended) const{
version_stream << VERSION;
if (extended) {
version_stream << std::endl << EXTENDED_VERSION;
version_stream << std::endl << EXTENDED_VERSION << std::endl
<< "database: " << isc::dhcp::Memfile_LeaseMgr::getDBVersion();
}
return (version_stream.str());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment