Bug#741453: libconfig-model-dpkg-perl: Feature wish: subcommand to add/remove elements to control fields, e.g. Uploaders
Dominique Dumont
dominique.dumont at hp.com
Tue Mar 18 12:20:14 UTC 2014
On Wednesday 12 March 2014 18:12:05 you wrote:
> Does not work. It always seems to remove the first entry of Uploaders.
> My fault. I missed the warning 'Argument "John Doe <user at example.org>"
> isn't numeric in splice at /usr/share/perl5/Config/Model/ListId.pm
> line 317.'
Yup. I should raise an error in this case.
> So the feature request is even more grounded on needs than before.
ok. I'm thinking about adding more instructions to tinker with list element
with Config::Model::Loader [1]. These new instructions would be directly
usable with 'cme modify'.
Here's what I'm thinking about:
* Replace xxx~yy with xxx:-yy (Delete item referenced by C<xxx> element and id
C<yy>).
* xxx-=yy :Remove the element whose value is C<yy>. For list or hash
* xxx-~/yy/: Remove the element whose value matches C<yy>. For list or hash
* xxx:<yy :Push C<yy> value on C<xxx> list (maybe provide also xxx.push(yy))
* xxx:>yy :Unshift C<yy> value on C<xxx> list (maybe provide also
xxx.unshift(yy))
* xxx:@ : Sort the list (maybe provide also xxx.sort)
* xxx:yy<zz or xxx.insert_at(yy,zz) : Insert C<zz> value on C<xxx>
list before B<index> C<yy>.
* xxx:~yy<zz or xxx.insert_before(/yy/,zz) :Insert C<zz> value on
C<xxx> list before B<value> matching C<yy>.
* xxx:=yy<zz or xxx.insert_before(yy,zz) : Insert C<zz> value on
C<xxx> list before B<value> C<yy>.
The short syntax is less typing, but can be difficult to remember. I wonder
which syntax I should support...
Thoughts ?
[1] http://search.cpan.org/dist/Config-Model/lib/Config/Model/Loader.pm
--
https://github.com/dod38fr/ -o- http://search.cpan.org/~ddumont/
http://ddumont.wordpress.com/ -o- irc: dod at irc.debian.org
More information about the pkg-perl-maintainers
mailing list