Default for ListOption

Martin Pool mbp at canonical.com
Wed Apr 21 06:59:23 BST 2010


On 21 April 2010 11:35, Robert Collins <robertc at robertcollins.net> wrote:
>
>
> On Wed, Apr 21, 2010 at 10:45 AM, Martin Pool <mbp at canonical.com> wrote:
>>
>> On 20 April 2010 22:14, Martin von Gagern <Martin.vGagern at gmx.net> wrote:>
>> I know that this would introduce a deliberate distinction between not
>> > passing "--bar" at all and passing "--bar=-". Do you think this is a
>> > good idea? If not, "--bar=-" might imply "use default" as well, and a
>> > new "--no-bar" option might provide a way to explicitely request an
>> > empty list.
>>
>> I don't think that's a good idea; for things like aliases or shell
>> scripting it seems a bit useful for --bar=- to mean "forget I ever
>> mentioned bar".  So --no-bar is perhaps the easiest for users and
>> shouldn't break the api.
>>
>> Some other programs seem to handle this with --bar=none though that's
>> a bit ugly with None vs 'none'.
>
> I'm confused, both of you seem to me to be saying the same thing about
> --bar=- - that it should mean 'not mentioned' or 'default', but you're
> saying that you see a difference? Could you expand on it?

I think I was agreeing with one of the alternatives he offered.  What
I think should happen is

 --bar=- means the same as not specifying bar at all

 if not specifying bar does not imply "no bars" (perhaps it means all
bars) then you should either add an explicit --no-bar or (perhaps)
--bar=none


-- 
Martin <http://launchpad.net/~mbp/>



More information about the bazaar mailing list