On Thu, Sep 13, 2012 at 2:22 AM, Ulrich Mueller wrote:
>>>>>> On Thu, 13 Sep 2012, Mike Frysinger wrote:
>>> Maybe it's better to add a --{save,restore} option pair:
>>>
>>> addwrite --save /foo/bar
>>> # some commands writing to /foo/bar here
>>> addwrite --restore # restore last saved state
>>>
>>> or --{push,pop} to allow for nested calls, but maybe that would be
>>> overkill.
>
>> not sure how your --save/--restore isn't a --push/--pop already
>
> --save/--restore would keep one saved state (which would be
> overwritten with the next --save), whereas --push/--pop would maintain
> a stack.
that wouldn't really be any different than if you implement the -r
option like so:
- `addwrite /foo` would always append the path regardless of
existence already in the variable
- `addwrite -r /foo` would remove exactly 1 occurence
so if you don't want to do push/pop, let's stick with just adding a -r
flag and implementing things as described above as it makes dev's
lives simpler.
-mike