mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Remove verbose option
Remove the command-line verbose option but let the ctrl-t c feature print some of the verbose information (active config path/section).
This commit is contained in:
parent
11df828f68
commit
28c880cdab
7 changed files with 13 additions and 29 deletions
|
|
@ -122,10 +122,6 @@ Display program version.
|
|||
.BR \-h ", " \-\-help
|
||||
|
||||
Display help.
|
||||
.TP
|
||||
.BR \-V ", " \-\-verbose
|
||||
|
||||
Enable verbose output.
|
||||
.SH "KEYS"
|
||||
.PP
|
||||
.TP 16n
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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 <code> 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);
|
||||
|
|
|
|||
|
|
@ -54,7 +54,6 @@ struct option_t
|
|||
const char *log_filename;
|
||||
const char *map;
|
||||
int color;
|
||||
bool debug;
|
||||
};
|
||||
|
||||
extern struct option_t option;
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@
|
|||
#include <time.h>
|
||||
#include <dirent.h>
|
||||
#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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue