From 78d19fa1c040f1ac15a4b97725e42a23f25af030 Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 24 Jul 2023 00:14:40 -0700 Subject: [PATCH] Explain usage of `monitor --config` in command help (#2249) The `--config` flag of the `arduino-cli monitor` command is used to configure the communication port used by the monitor. Previously the command line help did not provide any guidance for the usage of this flag, which might lead the users to wonder: - How can the configuration options available for use via the flag be determined? - What is the format for the configuration option argument? The information is provided in the FAQ page of the documentation, but that is not as convenient a source of information as the command line help and the user may not even be aware of its existence. The command help is hereby adjusted to provide the user with this information: - Create a conceptual linkage between the `--config` and `--describe` flags by using the "communication port settings" terminology in the references of both. - Document the argument format. In addition to the comma-separated list format I documented here, an alternative usage of passing multiple `--config` flags is also supported. I chose the former because I felt that the descriptions of the latter in either command line notation (e.g., `[--config =]...`) or in prose (e.g., "The format is =. Can be used multiple times for multiple settings.") were less clear. --- internal/cli/monitor/monitor.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/cli/monitor/monitor.go b/internal/cli/monitor/monitor.go index b3f65e04fcb..6fcf4a87de6 100644 --- a/internal/cli/monitor/monitor.go +++ b/internal/cli/monitor/monitor.go @@ -59,7 +59,7 @@ func NewCommand() *cobra.Command { } portArgs.AddToCommand(monitorCommand) monitorCommand.Flags().BoolVar(&describe, "describe", false, tr("Show all the settings of the communication port.")) - monitorCommand.Flags().StringSliceVarP(&configs, "config", "c", []string{}, tr("Configuration of the port.")) + monitorCommand.Flags().StringSliceVarP(&configs, "config", "c", []string{}, tr("Configure communication port settings. The format is =[,=]...")) monitorCommand.Flags().BoolVarP(&quiet, "quiet", "q", false, tr("Run in silent mode, show only monitor input and output.")) fqbn.AddToCommand(monitorCommand) monitorCommand.MarkFlagRequired("port")