[U-Boot] does u-boot automatically determine valid command abbreviations?

Wolfgang Denk wd at denx.de
Thu Jul 14 21:42:02 CEST 2016


Dear Robert,

In message <alpine.LFD.2.20.1607140645350.11114 at localhost.localdomain> you wrote:
> 
>   i just want to confirm that u-boot *automatically* determines the
> valid prefix abbreviations for u-boot commands, correct? as in, there
> is no registration or configuration to do that, it's done
> automatically based on the commands that have been configured into
> u-boot and whether a command abbreviation represents a unique prefix
> for all configured commands, yes?

Correct.

> i ask only because, recently, someone made the
> claim in some u-boot instructions i'm reading:
> 
>   * Use “setenv” command instead of “set” for target boards.  u-boot
>     source is not yet modified to alias “setenv” to “set”. Other
>     commands like “printenv” and “saveenv” can still be called as
>     “print” and “save”.
> 
> huh? why would someone have to "modify" the source to allow "set" to
> be a valid abbreviation for "setenv"? (aside: these instructions mix
> advice for both current and very old versions of u-boot, so maybe that
> claim is only for very old versions.)

I cannot comment on the "modify" part, as it makes no sense to me.
But I can comment on the background of the story:  In the early days
of U-Boot, actually for ages, it has been more or less standard habit
to most experienced users to just write "set" instead of "setenv", as
this was sufficient to uniquely identify that command.   This was also
used in a ton of scripts.

Then, at some point, a new command (can't remember which one it was;
eventually "setdcr"?) was added, and "set" was no longer a unique
prefix, old habits and a ton of scripts broke.

So habits had to be adjusted to type "sete" instead.  So were
scripts.  The word was fine again.

You guess what happened?  Right - then the command "setexpr" was
added, and again "sete" was no longer unique.

Moral of the stroy: use "env set" ;-)

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
Work 8 hours, sleep 8 hours; but not the same 8 hours.


More information about the U-Boot mailing list