grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [BUG] GRUBs option parsing needs fixing


From: Andreas Vogel
Subject: Re: [BUG] GRUBs option parsing needs fixing
Date: Thu, 08 Mar 2012 17:11:28 +0100
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2

Am 08.03.2012 16:37, schrieb Vladimir 'φ-coder/phcoder' Serbinenko:
> On 08.03.2012 16:28, Lennart Sorensen wrote:
>> On Thu, Mar 08, 2012 at 04:18:05PM +0100, Vladimir 'φ-coder/phcoder'
>> Serbinenko wrote:
>>> We don't have to recreate whole GNU in GRUB either, we don't write
>>> an OS but a bootloader. In particular having -xfoo for isn't
>>> necessarry and moreover it will conflict with
>>> search -su<UUID>
>> So a 'short' option that looks like a 'long' option?
>>
>> Or is that -s and -u together?
> It's -s and -u together and so -s has no argument. With Andreas
> proposition "u" would be the argument
Btw, that's the POSIX/GNU proposition. ;)

>> Options can get confusing at times?
>>
>>> which is already used in the wild.
>>> The case of --long-option optional argument can be changed
>>> especially taking into account migration from 1.98 but -xfoo is
>>> probably out of the question.
>> I don't see how -xfoo where foo is a parameter for -x can work if you
>> support multiple short options being merged (which seems common in
>> GNU programs).
> You can if when encountering an option needing parameter you parse the
> rest as parameter. But then again optional parameter are tricky.
> Behaviour similar to other GNU is important but compatibility with
> previous version of GRUB is more so, especially when it comes to the
> rarely used features like -xfoo. 
That's the big misinterpretation done in the past: without being able to
handle "-xfoo" you'll not be able to handle optional arguments in a
proper way. So it's nothing about using a rarely used feature.

The guys writing the POSIX/GNU recommendation did a great job and they
knew exactly what they proposed and for what reasons.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]