… | |
… | |
298 | @ARGV >= 2 |
298 | @ARGV >= 2 |
299 | or die "profile name or subcommand are missing\n"; |
299 | or die "profile name or subcommand are missing\n"; |
300 | my $name = shift @ARGV; |
300 | my $name = shift @ARGV; |
301 | |
301 | |
302 | $profile = $cfg->{profile}{$name} ||= {}; |
302 | $profile = $cfg->{profile}{$name} ||= {}; |
|
|
303 | ++$cfg->{dirty}; |
303 | |
304 | |
304 | docmd; |
305 | docmd; |
305 | }, |
306 | }, |
306 | delprofile => sub { |
307 | delprofile => sub { |
307 | @ARGV >= 1 |
308 | @ARGV >= 1 |
308 | or die "profile name is missing\n"; |
309 | or die "profile name is missing\n"; |
309 | my $name = shift @ARGV; |
310 | my $name = shift @ARGV; |
310 | |
311 | |
311 | delete $cfg->{profile}{$name}; |
312 | delete $cfg->{profile}{$name}; |
|
|
313 | ++$cfg->{dirty}; |
312 | }, |
314 | }, |
313 | ); |
315 | ); |
314 | |
316 | |
315 | sub docmd { |
317 | sub docmd { |
316 | my $cmd = shift @ARGV; |
318 | my $cmd = shift @ARGV; |