diff --git a/autogen.sh b/autogen.sh index 896618d29..a6b2d4e4a 100755 --- a/autogen.sh +++ b/autogen.sh @@ -99,6 +99,12 @@ fi NO_AUTOMAKE=yes } +(help2man --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "**Error**: You must have \`html2man' installed." + echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/" + DIE=1 +} # if no automake, don't bother testing for aclocal test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || { diff --git a/configure.ac b/configure.ac index 5fcce5571..277d52bb0 100644 --- a/configure.ac +++ b/configure.ac @@ -46,6 +46,8 @@ DX_PDF_FEATURE(OFF) DX_PS_FEATURE(OFF) DX_INIT_DOXYGEN([icinga], [docs/Doxyfile], [docs/dev]) +AM_MISSING_PROG(HELP2MAN, help2man, $missing_dir) + AC_PROG_INSTALL AC_PROG_LEX AC_PROG_YACC diff --git a/docs/.gitignore b/docs/.gitignore index ea1f64508..62c58f085 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -2,4 +2,4 @@ Doxyfile icinga2-intro.html icinga2-config.html icinga2-config.xml - +icinga2.8 diff --git a/docs/Makefile.am b/docs/Makefile.am index ee4e075c3..01e30ec92 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -2,17 +2,24 @@ EXTRA_DIST = \ icinga2-config.txt \ - icinga2-intro.txt + icinga2-intro.txt \ + icinga2.8 icinga2docdir = ${docdir} icinga2doc_DATA = \ icinga2-config.html \ icinga2-intro.html +man1_MANS = \ + icinga2.8 + .SUFFIXES = .html .txt .txt.html: asciidoc -a toc -a numbered $< -clean: +icinga2.8: $(top_srcdir)/icinga-app/icinga2 + -$(HELP2MAN) --name='The Icinga 2 networking monitoring daemon.' --section=8 --no-info --output=$@ $(top_srcdir)/icinga-app/icinga2 + +distclean: rm -f $(icinga2doc_DATA) diff --git a/icinga-app/icinga.cpp b/icinga-app/icinga.cpp index b12f8a117..f6b66bd10 100644 --- a/icinga-app/icinga.cpp +++ b/icinga-app/icinga.cpp @@ -186,15 +186,25 @@ int main(int argc, char **argv) Application::SetDebugging(true); if (g_AppParams.count("help") || g_AppParams.count("version")) { - std::cout << "Icinga application loader" + String appName = Utility::BaseName(argv[0]); + + if (appName.GetLength() > 3 && appName.SubStr(0, 3) == "lt-") + appName = appName.SubStr(3, appName.GetLength() - 3); + + std::cout << appName << " " << "- The Icinga 2 networking monitoring daemon."; + + if (g_AppParams.count("version")) { #ifndef _WIN32 - << " (version: " << ICINGA_VERSION << ")" + std::cout << " (Version: " << ICINGA_VERSION << ")"; #endif /* _WIN32 */ - << std::endl - << "Copyright (c) 2012-2013 Icinga Development Team (http://www.icinga.org)" << std::endl - << "License GPLv2+: GNU GPL version 2 or later " << std::endl - << "This is free software: you are free to change and redistribute it." << std::endl - << "There is NO WARRANTY, to the extent permitted by law." << std::endl; + std::cout << std::endl + << "Copyright (c) 2012-2013 Icinga Development Team (http://www.icinga.org)" << std::endl + << "License GPLv2+: GNU GPL version 2 or later " << std::endl + << "This is free software: you are free to change and redistribute it." << std::endl + << "There is NO WARRANTY, to the extent permitted by law."; + } + + std::cout << std::endl; if (g_AppParams.count("version")) return EXIT_SUCCESS;