All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: grub-devel@gnu.org
Subject: Re: [PATCH] Document menuentry --id option
Date: Mon, 21 Jan 2013 20:48:51 +0100	[thread overview]
Message-ID: <50FD9BA3.10805@gmail.com> (raw)
In-Reply-To: <20130121184446.5ab5fe87@opensuse.site>

[-- Attachment #1: Type: text/plain, Size: 3095 bytes --]

On 21.01.2013 15:44, Andrey Borzenkov wrote:

> В Sun, 20 Jan 2013 23:51:46 +0100
> Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com> пишет:
> 
>>>  @deffn Command menuentry @var{title} @
>>>   [@option{--class=class} @dots{}] [@option{--users=users}] @
>>> - [@option{--unrestricted}] [@option{--hotkey=key}] @
>>> + [@option{--unrestricted}] [@option{--hotkey=key}] [@option{--id=id}] @
>>>   @{ @var{command}; @dots{} @}
>>>  This defines a GRUB menu entry named @var{title}.  When this entry is
>>>  selected from the menu, GRUB will set the @var{chosen} environment variable
>>> -to @var{title}, execute the list of commands given within braces, and if the
>>> +to value of @option{--id} or @var{title} if @option{--id} is not given,
>>> +execute the list of commands given within braces, and if the
>>
>> It's better to not mention the possible usage of title for this at all.
>> Ehile it's kept for backward compatibility it has problems when language
>> or disk name changes and hence discouraged.
>>
> 
> I understand that, but you still need to explain what happens when --id
> is not given. Or make it mandatory argument.

Such an entry would be considered as not identifiable other than by its
number. The only reason why it's not so is because of backward
compatibility.
Documentation isn't just a description of the code but certain
committment to what is considered right and supported. If user relies on
something intentionally undocumented and gets bitten by it he has only
himself to blame while if he does something according to doc it will be
another case of figure.

> 
>>>  last command in the list returned successfully and a kernel was loaded it
>>>  will execute the @command{boot} command.
>>>  
>>> @@ -3135,6 +3136,9 @@
>>>  The @option{--hotkey} option associates a hotkey with a menu entry.
>>>  @var{key} may be a single letter, or one of the aliases @samp{backspace},
>>>  @samp{tab}, or @samp{delete}.
>>> +
>>> +The @option{--id} may be used to associate unique identifier with a menu entry.
>>> +@var{id} is arbitrary string.
>>
>> It has to be
>> [a-zA-Z_][0-9a-zA-Z_]*
> 
> It is not what grub currently does :) Do you really mean underscore?
> Grub is currently using hyphen.
> 

[a-zA-Z_-][0-9a-zA-Z_-]*

>> (while arbitrary string would work it's not a good idea.
>>
> 
> Sure, but again - it can be arbitrary string. Nothing restricts
> character set used.

You're wrong on this. '>' has special meaning and purely numerical id
wouldn't work either. Only [a-zA-Z_-][0-9a-zA-Z_-]* are guaranteed to
work in future versions.

> My goal is to document current grub behavior. Lying
> about what it does just adds to confusion. I'm fine with adding "it is
> recommended to restrict value @var{id} to alphanumeric ASCII
> characters, hyphen and underscore for portability".
> 

Again specifying in documentation what happens on bad ids would be
committing to some form of handling of them which is counterproductive.
-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]

  reply	other threads:[~2013-01-21 19:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-18 16:53 [PATCH] Document menuentry --id option Andrey Borzenkov
2013-01-20 22:51 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-01-21 14:44   ` Andrey Borzenkov
2013-01-21 19:48     ` Vladimir 'φ-coder/phcoder' Serbinenko [this message]
2013-01-22 11:36       ` Andrey Borzenkov

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=50FD9BA3.10805@gmail.com \
    --to=phcoder@gmail.com \
    --cc=grub-devel@gnu.org \
    /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.