mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] of_node: clearify help text and do stricter commandline parsing
Date: Wed, 8 Aug 2018 09:30:04 +0200	[thread overview]
Message-ID: <20180808073004.xoqrpv35z62rgade@pengutronix.de> (raw)
In-Reply-To: <20180806191418.15921-1-u.kleine-koenig@pengutronix.de>

On Mon, Aug 06, 2018 at 09:14:18PM +0200, Uwe Kleine-König wrote:
> To create an oftree node /path/node I tried after reading the help text
> of of_node:
> 
> 	of_node -c /path node
> 
> similar to the syntax of of_property. This didnt result in any output
> but still failed to do what I meant.
> 
> So clearify the help text to not suggest there are two parameters and
> return an usage error if still two (or more) names are passed.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  commands/of_node.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/commands/of_node.c b/commands/of_node.c
> index 29cc371dd289..28c4357c5d97 100644
> --- a/commands/of_node.c
> +++ b/commands/of_node.c
> @@ -107,11 +107,10 @@ static int do_of_node(int argc, char *argv[])
>  		}
>  	}
>  
> -	if (optind == argc)
> +	if (optind + 1 != argc)
>  		return COMMAND_ERROR_USAGE;
>  
> -	if (optind < argc)
> -		path = argv[optind];
> +	path = argv[optind];
>  
>  	if (!path)
>  		return COMMAND_ERROR_USAGE;
> @@ -147,7 +146,7 @@ BAREBOX_CMD_HELP_END
>  BAREBOX_CMD_START(of_node)
>  	.cmd		= do_of_node,
>  	BAREBOX_CMD_DESC("create/delete nodes in the device tree")
> -	BAREBOX_CMD_OPTS("[-cd] [-f] NODE NAME")
> +	BAREBOX_CMD_OPTS("[-cd] [-f] NODEPATH")
>  	BAREBOX_CMD_GROUP(CMD_GRP_MISC)
>  	BAREBOX_CMD_COMPLETE(devicetree_complete)
>  	BAREBOX_CMD_HELP(cmd_of_node_help)
> -- 
> 2.18.0
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2018-08-08  7:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-06 19:14 Uwe Kleine-König
2018-08-08  7:30 ` Sascha Hauer [this message]

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=20180808073004.xoqrpv35z62rgade@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=u.kleine-koenig@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