From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1TxNMf-0006A4-Uj for mharc-grub-devel@gnu.org; Mon, 21 Jan 2013 14:49:05 -0500 Received: from eggs.gnu.org ([208.118.235.92]:50918) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TxNMb-0005y5-Tb for grub-devel@gnu.org; Mon, 21 Jan 2013 14:49:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TxNMa-0003Cq-Fc for grub-devel@gnu.org; Mon, 21 Jan 2013 14:49:01 -0500 Received: from mail-wi0-f181.google.com ([209.85.212.181]:53607) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TxNMa-0003Cf-62 for grub-devel@gnu.org; Mon, 21 Jan 2013 14:49:00 -0500 Received: by mail-wi0-f181.google.com with SMTP id hq4so5263080wib.8 for ; Mon, 21 Jan 2013 11:48:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:x-enigmail-version:content-type; bh=DvUnymccAFF10SnvnP2N0/Kaeg3Fbnz9Ftiy6Ks3Elc=; b=VQlPqn+1yozURaurVinwhaPL+19Zmc/CcbQEu2GwxAIH2rOYsscOM1p3tFNak9nhyd +FxhXjKq1b+Q2+3RgwZqtUKrBeg0xJoyvaj9n0yUgKb/yS5VxRcW8xvnf4t4J0LEqsOa BgL+YTmFLZFA20DfkBenjSMSQhc9vLMd7hV+2MSAPGEkPfBahAznyj+Vwu0iE2dtM0jZ OVOWfrqssvwYBiHXWEBBtohwhnvdeWxA6a09z1znfjxyyJA28rpqOoeUAQu7KtjT+UxW CdAXOVQevM5u+kLMGLDJr1xf6vPDqVaS6jCxv1cAKb/Ik0DuYu08OpGqxfXq4yT71xb9 wZ0Q== X-Received: by 10.180.14.10 with SMTP id l10mr17285890wic.7.1358797739236; Mon, 21 Jan 2013 11:48:59 -0800 (PST) Received: from debian.x201.phnet ([217.193.148.98]) by mx.google.com with ESMTPS id df2sm18305073wib.0.2013.01.21.11.48.57 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 21 Jan 2013 11:48:58 -0800 (PST) Message-ID: <50FD9BA3.10805@gmail.com> Date: Mon, 21 Jan 2013 20:48:51 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.11) Gecko/20121122 Icedove/10.0.11 MIME-Version: 1.0 To: grub-devel@gnu.org Subject: Re: [PATCH] Document menuentry --id option References: <1347987201.1612.5.camel@opensuse.site> <50FC7502.2070006@gmail.com> <20130121184446.5ab5fe87@opensuse.site> In-Reply-To: <20130121184446.5ab5fe87@opensuse.site> X-Enigmail-Version: 1.4.1 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enig7A4FC5E490BE58860DA8D683" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.212.181 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2013 19:49:04 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig7A4FC5E490BE58860DA8D683 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 21.01.2013 15:44, Andrey Borzenkov wrote: > =D0=92 Sun, 20 Jan 2013 23:51:46 +0100 > Vladimir '=CF=86-coder/phcoder' Serbinenko =D0=BF=D0= =B8=D1=88=D0=B5=D1=82: >=20 >>> @deffn Command menuentry @var{title} @ >>> [@option{--class=3Dclass} @dots{}] [@option{--users=3Dusers}] @ >>> - [@option{--unrestricted}] [@option{--hotkey=3Dkey}] @ >>> + [@option{--unrestricted}] [@option{--hotkey=3Dkey}] [@option{--id=3D= id}] @ >>> @{ @var{command}; @dots{} @} >>> This defines a GRUB menu entry named @var{title}. When this entry i= s >>> selected from the menu, GRUB will set the @var{chosen} environment v= ariable >>> -to @var{title}, execute the list of commands given within braces, an= d if the >>> +to value of @option{--id} or @var{title} if @option{--id} is not giv= en, >>> +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= =2E >> Ehile it's kept for backward compatibility it has problems when langua= ge >> or disk name changes and hence discouraged. >> >=20 > 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. >=20 >>> last command in the list returned successfully and a kernel was load= ed it >>> will execute the @command{boot} command. >>> =20 >>> @@ -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{backsp= ace}, >>> @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_]* >=20 > It is not what grub currently does :) Do you really mean underscore? > Grub is currently using hyphen. >=20 [a-zA-Z_-][0-9a-zA-Z_-]* >> (while arbitrary string would work it's not a good idea. >> >=20 > 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". >=20 Again specifying in documentation what happens on bad ids would be committing to some form of handling of them which is counterproductive. --=20 Regards Vladimir '=CF=86-coder/phcoder' Serbinenko --------------enig7A4FC5E490BE58860DA8D683 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iF4EAREKAAYFAlD9m6MACgkQNak7dOguQglFjwD/WiedQo6LRl4sUTDKoeSaJJnw L2zSoWiaavqHjULkoDABALuOq1o2NU0nGO2uSCCYa5BRVdSxKdPXLH/eROdyyfas =SdG5 -----END PGP SIGNATURE----- --------------enig7A4FC5E490BE58860DA8D683--