From: Roland Hieber <rhi@pengutronix.de>
To: Jonas Rebmann <jre@pengutronix.de>
Cc: oss-tools@pengutronix.de
Subject: Re: [OSS-Tools] [PATCH microcom] main: error out on positional arguments
Date: Mon, 24 Nov 2025 12:24:31 +0100 [thread overview]
Message-ID: <1763983436-9dacb7c56871e66433da2102@pty> (raw)
In-Reply-To: <20250104151725.12843-1-jre@pengutronix.de>
On Sat, Jan 04, 2025 at 04:17:25PM +0100, Jonas Rebmann wrote:
> As microcom makes no use of positional arguments, error out and show
> usage if a positional argument is presented.
>
> Without this patch, invalid usage involving a positional such as
> microcom /dev/ttyUSB0 is silently ignored.
>
> Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
For the record, microcom uses GiHub and this has been merged in
<https://github.com/pengutronix/microcom/pull/48>.
> ---
> microcom.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/microcom.c b/microcom.c
> index 2b3d484..974c0cf 100644
> --- a/microcom.c
> +++ b/microcom.c
> @@ -183,6 +183,10 @@ int main(int argc, char *argv[])
> }
> }
>
> + if (optind < argc) {
> + main_usage(1, "", "");
> + }
> +
> if (answerback) {
> ret = asprintf(&answerback, "%s\n", answerback);
> if (ret < 0)
> --
> 2.39.5
>
>
>
--
Roland Hieber, Pengutronix e.K. | rhi@pengutronix.de |
Steuerwalder Str. 21 | https://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2025-11-24 11:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-04 15:17 Jonas Rebmann
2025-11-24 11:24 ` Roland Hieber [this message]
2025-11-24 13:32 ` Jonas Rebmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1763983436-9dacb7c56871e66433da2102@pty \
--to=rhi@pengutronix.de \
--cc=jre@pengutronix.de \
--cc=oss-tools@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox