All of lore.kernel.org
 help / color / mirror / Atom feed
From: Quentin Schulz <quentin.schulz@cherry.de>
To: Tom Rini <trini@konsulko.com>
Cc: u-boot@lists.denx.de, Heinrich Schuchardt <xypron.glpk@gmx.de>
Subject: Re: [PATCH 2/3] doc: askenv: Reword and remove return value
Date: Wed, 22 Oct 2025 16:06:09 +0200	[thread overview]
Message-ID: <cc194cf3-ccca-4e66-b3f5-e60cce7da20a@cherry.de> (raw)
In-Reply-To: <20251022134929.GH6688@bill-the-cat>

On 10/22/25 3:49 PM, Tom Rini wrote:
> On Wed, Oct 22, 2025 at 11:28:15AM +0200, Quentin Schulz wrote:
>> Hi Tom,
>>
>> On 10/21/25 10:25 PM, Tom Rini wrote:
>>> With the addition of general text about how the return value is handled,
>>> remove the examples from the askenv documentation as they are all normal
>>> expected results.
>>>
>>> Signed-off-by: Tom Rini <trini@konsulko.com>
>>> ---
>>> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
>>> ---
>>>    doc/usage/cmd/askenv.rst | 27 +++------------------------
>>>    1 file changed, 3 insertions(+), 24 deletions(-)
>>>
>>> diff --git a/doc/usage/cmd/askenv.rst b/doc/usage/cmd/askenv.rst
>>> index e2b3c5379aea..a8867ce4d266 100644
>>> --- a/doc/usage/cmd/askenv.rst
>>> +++ b/doc/usage/cmd/askenv.rst
>> [...]
>>> -Return Value of askenv command, when used without any other arguments:
>>> -
>>> -::
>>> -
>>> -    => askenv;echo $?
>>> -    askenv - get environment variables from stdin
>>> -
>>> -    Usage:
>>> -    askenv name [message] [size]
>>> -        - display 'message' and get environment variable 'name' from stdin (max 'size' chars)
>>> -    1
>>
>> Shouldn't that be -1 here to match the expected return value when the syntax
>> is incorrect?
>>
>> If it is 1, then it's a difference to the expected return value and thus
>> should be documented below?
> 
> This was included seemingly to include the built-in help message
> in-text. If desired, we should figure out how to do that automatically
> and for all commands.
> 

Agreed, it'd be awesome to extract the _usage part of U_BOOT_CMDs as 
summary for doc/usage/cmd/*.rst and _help part as the synopsis part so 
that they don't need to be kept in sync (at least that part).

> This is separate from what I see this morning right now of any invalid
> usage returning "1" and not "-1".
> 
> This is from sandbox build yesterday on top of tree:
> => loadm y y y y y y
> loadm - load binary blob from source address to destination address
> 
> Usage:
> loadm [src_addr] [dst_addr] [size]
>       - load a binary blob from one memory location to other from src_addr to dst_addr by size bytes
> => echo $?
> 1
> 

Then patch 1 is wrong? Or rather, what is moved in patch 1 is wrong?

"""
values are 0 on success, -1 on a usage related errors, i. e. invalid 
syntax and 1 on any other error.
"""

loadm y y y y y y would be an invalid syntax, meaning the return value 
is expected to be -1 according to the definition above.

  reply	other threads:[~2025-10-22 14:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-21 20:25 [PATCH 0/3] doc: Add a general note about $? Tom Rini
2025-10-21 20:25 ` [PATCH 1/3] doc: usage: Add general rule for `$?` Tom Rini
2025-10-22  9:19   ` Quentin Schulz
2025-10-22 13:54     ` Tom Rini
2025-10-22 14:24       ` Quentin Schulz
2025-10-21 20:25 ` [PATCH 2/3] doc: askenv: Reword and remove return value Tom Rini
2025-10-22  9:28   ` Quentin Schulz
2025-10-22 13:49     ` Tom Rini
2025-10-22 14:06       ` Quentin Schulz [this message]
2025-10-22 14:47         ` Tom Rini
2025-10-21 20:25 ` [PATCH 3/3] doc: seama: Reword return value section Tom Rini
2025-10-22  9:33   ` Quentin Schulz
2025-10-22 13:51     ` Tom Rini
2025-10-22 14:09       ` Quentin Schulz

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=cc194cf3-ccca-4e66-b3f5-e60cce7da20a@cherry.de \
    --to=quentin.schulz@cherry.de \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.