From 5b6a106b34fbeaf790dae8bef8e31ca9be416dd6 Mon Sep 17 00:00:00 2001 From: Martin Lund Date: Wed, 1 Jun 2022 19:26:42 +0200 Subject: [PATCH] Improve help and man page --- man/tio.1.in | 16 ++++++++-------- src/options.c | 5 +++-- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/man/tio.1.in b/man/tio.1.in index 8665a41..f114af0 100644 --- a/man/tio.1.in +++ b/man/tio.1.in @@ -6,13 +6,13 @@ tio \- a simple serial terminal I/O tool .SH "SYNOPSIS" .PP .B tio -.RI "[" "] " "" +.RI "[" "] " "" .SH "DESCRIPTION" .PP .B tio is a simple serial terminal tool which features a straightforward command-line -interface to easily connect to serial/TTY devices for basic I/O operations. +interface to easily connect to serial TTY devices for basic I/O operations. .SH "OPTIONS" @@ -176,14 +176,14 @@ Show version Options can be set via a configuration file using the INI format. tio uses the configuration file first found in the following locations in the order listed: $XDG_CONFIG_HOME/tio/tiorc, $HOME/.config/tio/tiorc, $HOME/.tiorc .TP -Sections can be used to group settings. +Config sections can be used to group settings. .TP .TP -tio will try to match the user input to a section by name or by pattern to get the tty and other options. +tio will try to match the user input to a config section by name or by pattern to get the tty and other options. .TP -Options without any section name sets the default options. +Options without any config section name sets the default options. .TP The following configuration file options are available: @@ -225,7 +225,7 @@ Set socket path (must include .SH "CONFIGURATION EXAMPLES" .TP -A typical section used as a short-hand would be defined as such: +A typical config section used as a short-hand would be defined as such: .RS .nf @@ -239,14 +239,14 @@ color=11 .RE .TP -With this section defined in the configuration file the following commands would be equivalent: +With this config section defined in the configuration file the following commands would be equivalent: tio ftdi tio -b 115200 /dev/serial/by-id/usb-FTDI_TTL232R-3V3_FTGQVXBL-if00-port0 .TP -A section can also be matched by its pattern which supports regular expressions: +A config section can also be matched by its pattern which supports regular expressions: .RS .nf diff --git a/src/options.c b/src/options.c index 638053c..5259c14 100644 --- a/src/options.c +++ b/src/options.c @@ -58,7 +58,7 @@ struct option_t option = void print_help(char *argv[]) { - printf("Usage: %s [] \n", argv[0]); + printf("Usage: %s [] \n", argv[0]); printf("\n"); printf("Options:\n"); printf(" -b, --baudrate Baud rate (default: 115200)\n"); @@ -159,7 +159,8 @@ void options_parse(int argc, char *argv[]) if (argc == 1) { - print_help(argv); + printf("Please provide tty device or name of configuration to use\n\n"); + printf("See %s --help for more details\n\n", *argv); exit(EXIT_SUCCESS); }