diff --git a/man/tio.1.in b/man/tio.1.in index 735586b..38c44d8 100644 --- a/man/tio.1.in +++ b/man/tio.1.in @@ -122,10 +122,6 @@ Display program version. .BR \-h ", " \-\-help Display help. -.TP -.BR \-V ", " \-\-verbose - -Enable verbose output. .SH "KEYS" .PP .TP 16n diff --git a/src/bash-completion/tio.in b/src/bash-completion/tio.in index 75539b8..d64d7e3 100644 --- a/src/bash-completion/tio.in +++ b/src/bash-completion/tio.in @@ -23,8 +23,7 @@ _tio() -t --timestamp \ -L --list-devices \ -c --color \ - -h --help" \ - -V --verbose \ + -h --help" # Complete the arguments to the options. case "${prev}" in @@ -89,10 +88,6 @@ _tio() COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) return 0 ;; - -V | --verbose) - COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) - return 0 - ;; *) ;; esac diff --git a/src/configfile.c b/src/configfile.c index 12a3955..9d11023 100644 --- a/src/configfile.c +++ b/src/configfile.c @@ -264,8 +264,12 @@ void config_exit(void) void config_file_print() { - tio_printf("INI:"); - tio_printf(" path: %s", c->path); - tio_printf(" searched section: %s", c->user); - tio_printf(" found section: %s", c->section_name); + if (c->path != NULL) + { + tio_printf(" Path: %s", c->path); + if (c->section_name != NULL) + { + tio_printf(" Active config section: %s", c->section_name); + } + } } diff --git a/src/main.c b/src/main.c index f88eb79..44cedf2 100644 --- a/src/main.c +++ b/src/main.c @@ -77,11 +77,6 @@ int main(int argc, char *argv[]) /* Print launch hints */ tio_printf("tio v%s", VERSION); tio_printf("Press ctrl-t q to quit"); - if (option.debug) - { - config_file_print(); - options_print(); - } /* Connect to tty device */ if (option.no_autoconnect) diff --git a/src/options.c b/src/options.c index c629400..fc24974 100644 --- a/src/options.c +++ b/src/options.c @@ -53,7 +53,6 @@ struct option_t option = .log_filename = "", .map = "", .color = -1, - .debug = false, }; void print_help(char *argv[]) @@ -76,7 +75,6 @@ void print_help(char *argv[]) printf(" -c, --color Colorize tio text\n"); printf(" -v, --version Display version\n"); printf(" -h, --help Display help\n"); - printf(" -V, --verbose Enable verbose output\n"); printf("\n"); printf("See the man page for more details.\n"); printf("\n"); @@ -135,7 +133,6 @@ enum timestamp_t timestamp_option_parse(const char *arg) void options_print() { - tio_printf("Configuration:"); tio_printf(" TTY device: %s", option.tty_device); tio_printf(" Baudrate: %u", option.baudrate); tio_printf(" Databits: %d", option.databits); @@ -181,7 +178,6 @@ void options_parse(int argc, char *argv[]) {"color", required_argument, 0, 'c'}, {"version", no_argument, 0, 'v'}, {"help", no_argument, 0, 'h'}, - {"verbose", no_argument, 0, 'V'}, {0, 0, 0, 0 } }; @@ -189,7 +185,7 @@ void options_parse(int argc, char *argv[]) int option_index = 0; /* Parse argument using getopt_long */ - c = getopt_long(argc, argv, "b:d:f:s:p:o:net::Ll::m:c:vhV", long_options, &option_index); + c = getopt_long(argc, argv, "b:d:f:s:p:o:net::Ll::m:c:vh", long_options, &option_index); /* Detect the end of the options */ if (c == -1) @@ -290,10 +286,6 @@ void options_parse(int argc, char *argv[]) exit(EXIT_SUCCESS); break; - case 'V': - option.debug = true; - break; - case '?': /* getopt_long already printed an error message */ exit(EXIT_FAILURE); diff --git a/src/options.h b/src/options.h index 2ae5e63..8010602 100644 --- a/src/options.h +++ b/src/options.h @@ -54,7 +54,6 @@ struct option_t const char *log_filename; const char *map; int color; - bool debug; }; extern struct option_t option; diff --git a/src/tty.c b/src/tty.c index 0f8badd..9667ac9 100644 --- a/src/tty.c +++ b/src/tty.c @@ -38,6 +38,7 @@ #include #include #include "config.h" +#include "configfile.h" #include "tty.h" #include "print.h" #include "options.h" @@ -163,6 +164,8 @@ void handle_command_sequence(char input_char, char previous_char, char *output_c break; case KEY_C: + tio_printf("Configuraiton:"); + config_file_print(); options_print(); break;