… | |
… | |
215 | setservices => sub { |
215 | setservices => sub { |
216 | $profile->{services} = [@ARGV]; |
216 | $profile->{services} = [@ARGV]; |
217 | @ARGV = (); |
217 | @ARGV = (); |
218 | ++$cfg->{dirty}; |
218 | ++$cfg->{dirty}; |
219 | }, |
219 | }, |
220 | addseed => sub { |
220 | addservice => sub { |
221 | my $service = shift @ARGV; |
221 | my $service = shift @ARGV; |
222 | push @{ $profile->{services} }, $service; |
222 | push @{ $profile->{services} }, $service; |
223 | ++$cfg->{dirty}; |
223 | ++$cfg->{dirty}; |
224 | }, |
224 | }, |
225 | delseed => sub { |
225 | delservice => sub { |
226 | my $service = shift @ARGV; |
226 | my $service = shift @ARGV; |
227 | for (0 .. $#{ $profile->{services} }) { |
227 | for (0 .. $#{ $profile->{services} }) { |
228 | next unless $profile->{services}[$_] eq $service; |
228 | next unless $profile->{services}[$_] eq $service; |
229 | splice @{ $profile->{services} }, $_, 1; |
229 | splice @{ $profile->{services} }, $_, 1; |
230 | last; |
230 | last; |