[PATCH 0/3] add "call" command

Wolfgang Denk wd at denx.de
Sat Sep 26 16:13:29 CEST 2020


Dear Heinrich,

In message <b2395001-191c-31f3-2682-ac3e9fcff236 at gmx.de> you wrote:
>
> > Nice idea!  Only we should do a better syntax (options preceeding
> > argument), i. e.
> >
> > 	run [ --args argv ] varname1 varname2 ...
> >
> > where argv would be the name of a variale to hold the arguments (as
> > a comma (?) separated list) ?
> In another mail you suggested "run arg1 arg2 ... -- varname1 varname2".

I was commenting on another suggestion.

> Whether arguments or script names are first or last does not make much
> of a difference for the implementation effort. Any way you have to loop
> over all arguments to find the separator "--".

It does not make a differenc in terms of implementation, but
tradition in UNIX systems is to have

	command_name [ -options ... ] arguments

i. e. options always came first.

It is only later tools that ignored how a proper program (TM) should
behave ;-)

> "better syntax" does not apply here as the two alternatives have the
> same expressivity, and need the same amount of typing and learning. It
> is a matter of taste.

Indeed. One is more pretty, and the other one is more ugly ;-)

> > Do you have an idea how the "script" would pull out the arguments
> > from that variable?
>
> Rasmus already suggested $1 .. $9 for the positional arguments (where
> counting should not stop at 9).

Fine with me.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The universe does not have laws - it has habits, and  habits  can  be
broken.


More information about the U-Boot mailing list