]> git.itanic.dy.fi Git - log-plotter/blobdiff - options.c
Use the same config structure for command line and config file
[log-plotter] / options.c
index 18db9c5e44e173ba1b24f70f4a44a44079187d6b..582b4e73627c86f5547b56e7896b6bba97a00f71 100644 (file)
--- a/options.c
+++ b/options.c
@@ -3,7 +3,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "options.h"
+#include "config.h"
 #include "trace.h"
 
 void print_help_and_die(const char *exec_name)
@@ -21,15 +21,15 @@ void print_help_and_die(const char *exec_name)
        exit(0);
 }
 
-static void set_default_options(struct plotter_options *opts)
+static void set_default_options(struct plotter_config *opts)
 {
        bzero(opts, sizeof(*opts));
 
-       opts->baud_rate = 128000;
+       opts->baudrate = 128000;
        opts->device_path = "/dev/ttyUSB0";
 }
 
-int read_args(int argc, char *argv[], struct plotter_options *opts)
+int read_args(int argc, char *argv[], struct plotter_config *opts)
 {
        int option_index = 0, c;
        static struct option long_options[] = {
@@ -57,10 +57,10 @@ int read_args(int argc, char *argv[], struct plotter_options *opts)
                        opts->device_path = optarg;
                        break;
                case 'o':
-                       opts->output_path = optarg;
+                       opts->log_path = optarg;
                        break;
                case 'b':
-                       opts->baud_rate = atoi(optarg);
+                       opts->baudrate = atoi(optarg);
                        break;
                case 'v':
                        trace_level++;