diff options
author | Daniel Friesel <derf@finalrewind.org> | 2011-05-16 10:57:17 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2011-05-16 10:57:17 +0200 |
commit | 06d064c1d6ba7a98c32527c0ca865c73fd65458e (patch) | |
tree | 6087dae2fa896602c995b88568e5646ee0f036cd /lib/App | |
parent | 60698a2b128a60d16ab87ade05cf88b8ad28800f (diff) |
Add "raps2 del"
Diffstat (limited to 'lib/App')
-rw-r--r-- | lib/App/Raps2.pm | 18 |
1 files changed, 18 insertions, 0 deletions
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<name>. + +=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 |