# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.68])
-AC_INIT([nqptp], [1.0d0], [4265913+mikebrady@users.noreply.github.com])
+AC_INIT([nqptp], [1.0d1], [4265913+mikebrady@users.noreply.github.com])
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([nqptp.c])
AC_CONFIG_HEADERS([config.h])
AC_CHECK_FUNCS([clock_gettime inet_ntoa memset select socket strerror])
AC_CONFIG_FILES([Makefile nqptp.service])
-AC_OUTPUT
\ No newline at end of file
+AC_OUTPUT
*
* Commercial licensing is also available.
*/
-
+#include "config.h"
#include "nqptp.h"
#include "debug.h"
#include "general-utilities.h"
exit(EXIT_SUCCESS);
}
-int main(void) {
- debug_init(DEBUG_LEVEL, 0, 1, 1);
+int main(int argc, char **argv) {
+
+ int debug_level = 0;
+ int i;
+ for( i = 1; i < argc; ++i ) {
+ if( argv[i][0] == '-' ) {
+ if(strcmp(argv[i] + 1, "V") == 0) {
+ fprintf(stdout, "%s\n",PACKAGE_STRING);
+ exit(EXIT_SUCCESS);
+ } else if(strcmp(argv[i] + 1, "vvv") == 0 ) {
+ debug_level = 3;
+ } else if( strcmp(argv[i] + 1, "vv" ) == 0 ) {
+ debug_level = 2;
+ } else if( strcmp(argv[i] + 1, "v" ) == 0 ) {
+ debug_level = 1;
+ } else if( strcmp(argv[i] + 1, "h" ) == 0 ) {
+ fprintf(stdout,
+ " -V print version,\n"
+ " -v verbose log,\n"
+ " -vv more verbose log,\n"
+ " -vvv very verbose log,\n"
+ " -h this help text.\n");
+ exit(EXIT_SUCCESS);
+ } else {
+ fprintf(stdout, "%s -- unknown option. Program terminated.\n", argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ }
+ }
+
+ debug_init(debug_level, 0, 1, 1);
debug(1, "startup");
atexit(goodbye);