about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2020-08-27 14:40:44 +0530
committerAndinus <andinus@nand.sh>2020-08-27 14:40:44 +0530
commit299d5ee6bedcf3285951caa515ad35c705a85f89 (patch)
tree6af8a396b2b6f2a24f4b601a01e259f2d75c25e1
parent18c8216959dd817d4b6f0971773174fb6e937af0 (diff)
downloadleo-299d5ee6bedcf3285951caa515ad35c705a85f89.tar.gz
Add delete option
This will remove the archive after running gpg2.
-rwxr-xr-xleo.pl7
1 files changed, 6 insertions, 1 deletions
diff --git a/leo.pl b/leo.pl
index 4790da5..d33604e 100755
--- a/leo.pl
+++ b/leo.pl
@@ -11,7 +11,7 @@ use Getopt::Long qw/ GetOptions /;
 my %options = ();
 GetOptions(
     \%options,
-    qw{ verbose encrypt sign }
+    qw{ verbose encrypt sign delete }
 ) or die "Error in command line arguments\n";
 
 my $gpg_fingerprint = "D9AE4AEEE1F1B3598E81D9DFB67D55D482A799FD";
@@ -85,6 +85,9 @@ sub encrypt_sign() {
     run3 ["gpg2", "--yes", "-o", "$file.gpg", @options, $file];
     warn "[WARN] $file.gpg exists, might overwrite.\n" if -e "$file.gpg";
     say "\nOutput: $file.gpg";
+
+    unlink $file and say "$file deleted."
+        or warn "[WARN] Could not delete $file: $!\n";
 }
 
 sub HelpMessage {
@@ -106,6 +109,8 @@ Options:
         Encrypt files with $gpg_fingerprint
     --sign
         Sign files with $gpg_fingerprint
+    --delete
+        Delete the archive after running gpg2
     --verbose};
 }
 
tter Kartik Agaram <vc@akkartik.com> 2020-12-29 19:14:26 -0800 7462 - SubX version of baremetal/ex2.subx' href='/akkartik/mu/commit/baremetal/ex2.subx?h=main&id=c5dfa89bb31bac8f03b646eaa3b5b204b854b2b9'>c5dfa89b ^
26697e64 ^








c5dfa89b ^
26697e64 ^



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35