From 06d064c1d6ba7a98c32527c0ca865c73fd65458e Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 16 May 2011 10:57:17 +0200 Subject: Add "raps2 del" --- lib/App/Raps2.pm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'lib') diff --git a/lib/App/Raps2.pm b/lib/App/Raps2.pm index 50d7005..273abee 100644 --- a/lib/App/Raps2.pm +++ b/lib/App/Raps2.pm @@ -346,6 +346,24 @@ sub cmd_list { } } +=item $raps2->cmd_remove(I<$name>) + +Remove (unlink) the account I. + +=cut + +sub cmd_remove { + my ($self, $name) = @_; + my $pwfile = $self->{xdg_data} . "/${name}"; + + if (-e $pwfile) { + unlink($pwfile); + } + else { + say STDERR 'File did not exist, so could not be removed'; + } +} + =back =head1 DEPENDENCIES -- cgit v1.2.3