mirror of
https://github.com/tio/tio.git
synced 2026-05-01 23:07:58 +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
|
.BR \-h ", " \-\-help
|
||||||
|
|
||||||
Display help.
|
Display help.
|
||||||
.TP
|
|
||||||
.BR \-V ", " \-\-verbose
|
|
||||||
|
|
||||||
Enable verbose output.
|
|
||||||
.SH "KEYS"
|
.SH "KEYS"
|
||||||
.PP
|
.PP
|
||||||
.TP 16n
|
.TP 16n
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,7 @@ _tio()
|
||||||
-t --timestamp \
|
-t --timestamp \
|
||||||
-L --list-devices \
|
-L --list-devices \
|
||||||
-c --color \
|
-c --color \
|
||||||
-h --help" \
|
-h --help"
|
||||||
-V --verbose \
|
|
||||||
|
|
||||||
# Complete the arguments to the options.
|
# Complete the arguments to the options.
|
||||||
case "${prev}" in
|
case "${prev}" in
|
||||||
|
|
@ -89,10 +88,6 @@ _tio()
|
||||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
-V | --verbose)
|
|
||||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
|
||||||
return 0
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
||||||
|
|
@ -264,8 +264,12 @@ void config_exit(void)
|
||||||
|
|
||||||
void config_file_print()
|
void config_file_print()
|
||||||
{
|
{
|
||||||
tio_printf("INI:");
|
if (c->path != NULL)
|
||||||
tio_printf(" path: %s", c->path);
|
{
|
||||||
tio_printf(" searched section: %s", c->user);
|
tio_printf(" Path: %s", c->path);
|
||||||
tio_printf(" found section: %s", c->section_name);
|
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 */
|
/* Print launch hints */
|
||||||
tio_printf("tio v%s", VERSION);
|
tio_printf("tio v%s", VERSION);
|
||||||
tio_printf("Press ctrl-t q to quit");
|
tio_printf("Press ctrl-t q to quit");
|
||||||
if (option.debug)
|
|
||||||
{
|
|
||||||
config_file_print();
|
|
||||||
options_print();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Connect to tty device */
|
/* Connect to tty device */
|
||||||
if (option.no_autoconnect)
|
if (option.no_autoconnect)
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,6 @@ struct option_t option =
|
||||||
.log_filename = "",
|
.log_filename = "",
|
||||||
.map = "",
|
.map = "",
|
||||||
.color = -1,
|
.color = -1,
|
||||||
.debug = false,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void print_help(char *argv[])
|
void print_help(char *argv[])
|
||||||
|
|
@ -76,7 +75,6 @@ void print_help(char *argv[])
|
||||||
printf(" -c, --color <code> Colorize tio text\n");
|
printf(" -c, --color <code> Colorize tio text\n");
|
||||||
printf(" -v, --version Display version\n");
|
printf(" -v, --version Display version\n");
|
||||||
printf(" -h, --help Display help\n");
|
printf(" -h, --help Display help\n");
|
||||||
printf(" -V, --verbose Enable verbose output\n");
|
|
||||||
printf("\n");
|
printf("\n");
|
||||||
printf("See the man page for more details.\n");
|
printf("See the man page for more details.\n");
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
@ -135,7 +133,6 @@ enum timestamp_t timestamp_option_parse(const char *arg)
|
||||||
|
|
||||||
void options_print()
|
void options_print()
|
||||||
{
|
{
|
||||||
tio_printf("Configuration:");
|
|
||||||
tio_printf(" TTY device: %s", option.tty_device);
|
tio_printf(" TTY device: %s", option.tty_device);
|
||||||
tio_printf(" Baudrate: %u", option.baudrate);
|
tio_printf(" Baudrate: %u", option.baudrate);
|
||||||
tio_printf(" Databits: %d", option.databits);
|
tio_printf(" Databits: %d", option.databits);
|
||||||
|
|
@ -181,7 +178,6 @@ void options_parse(int argc, char *argv[])
|
||||||
{"color", required_argument, 0, 'c'},
|
{"color", required_argument, 0, 'c'},
|
||||||
{"version", no_argument, 0, 'v'},
|
{"version", no_argument, 0, 'v'},
|
||||||
{"help", no_argument, 0, 'h'},
|
{"help", no_argument, 0, 'h'},
|
||||||
{"verbose", no_argument, 0, 'V'},
|
|
||||||
{0, 0, 0, 0 }
|
{0, 0, 0, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -189,7 +185,7 @@ void options_parse(int argc, char *argv[])
|
||||||
int option_index = 0;
|
int option_index = 0;
|
||||||
|
|
||||||
/* Parse argument using getopt_long */
|
/* 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 */
|
/* Detect the end of the options */
|
||||||
if (c == -1)
|
if (c == -1)
|
||||||
|
|
@ -290,10 +286,6 @@ void options_parse(int argc, char *argv[])
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'V':
|
|
||||||
option.debug = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case '?':
|
case '?':
|
||||||
/* getopt_long already printed an error message */
|
/* getopt_long already printed an error message */
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,6 @@ struct option_t
|
||||||
const char *log_filename;
|
const char *log_filename;
|
||||||
const char *map;
|
const char *map;
|
||||||
int color;
|
int color;
|
||||||
bool debug;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct option_t option;
|
extern struct option_t option;
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#include "configfile.h"
|
||||||
#include "tty.h"
|
#include "tty.h"
|
||||||
#include "print.h"
|
#include "print.h"
|
||||||
#include "options.h"
|
#include "options.h"
|
||||||
|
|
@ -163,6 +164,8 @@ void handle_command_sequence(char input_char, char previous_char, char *output_c
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case KEY_C:
|
case KEY_C:
|
||||||
|
tio_printf("Configuraiton:");
|
||||||
|
config_file_print();
|
||||||
options_print();
|
options_print();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue