about summary refs log tree commit diff stats
path: root/leo.pl
diff options
context:
space:
mode:
Diffstat (limited to 'leo.pl')
-rwxr-xr-xleo.pl18
1 files changed, 12 insertions, 6 deletions
diff --git a/leo.pl b/leo.pl
index 135b3d7..3836bbe 100755
--- a/leo.pl
+++ b/leo.pl
@@ -10,8 +10,8 @@ use POSIX qw(strftime);
 
 die "usage: leo [-hpvV] <profile>\n" unless scalar @ARGV;
 
-my ($VERBOSE, $PRINT_PROFILES);
-my $VERSION = "v0.5.0";
+my ($VERBOSE, $PRINT_PROFILES, $PRINT_PROFILES_VERBOSE);
+my $VERSION = "v0.5.1";
 
 # Dispatch table to be parsed before url.
 my %dispatch = (
@@ -19,6 +19,7 @@ my %dispatch = (
     '-v'  => sub { $VERBOSE = 1; },
     '-h'  => \&HelpMessage,
     '-p'  => sub { $PRINT_PROFILES = 1; },
+    '-P'  => sub { $PRINT_PROFILES = 1; $PRINT_PROFILES_VERBOSE = 1; },
 );
 if (exists $dispatch{$ARGV[0]}) {
     # shift @ARGV to get profile in next shift.
@@ -132,7 +133,7 @@ sub run_gnupg {
     my $prof = shift @_;
     my $file = shift @_;
 
-    my @options = ( "--sign", "--encrypt",
+    my @options = ( "--encrypt",
                     "--yes",
                     "-o", "${file}.gpg"
                 );
@@ -142,6 +143,8 @@ sub run_gnupg {
         "--recipient", $options{gpg_fingerprint}
         if $options{gpg_fingerprint};
 
+    push @options, "--sign" unless $profile{$prof}{L_GnuPG_no_sign};
+
     # Add recipients.
     my @gpg_recipients;
     @gpg_recipients = split / /, $options{gpg_recipients}
@@ -180,12 +183,15 @@ sub PrintProfiles {
     foreach my $prof (sort keys %profile) {
         print "    $prof";
         print " [GnuPG]" if $profile{$prof}{L_GnuPG};
+        print " [No Sign]" if $profile{$prof}{L_GnuPG_no_sign};
         print " [Signify]" if $profile{$prof}{L_signify};
         print "\n";
 
-        print "        + $_\n" foreach $profile{$prof}{backup}->@*;
-        print "        - $_\n" foreach $profile{$prof}{exclude}->@*;
-        print "\n";
+        if ($PRINT_PROFILES_VERBOSE) {
+            print "        + $_\n" foreach $profile{$prof}{backup}->@*;
+            print "        - $_\n" foreach $profile{$prof}{exclude}->@*;
+            print "\n";
+        }
     }
 }
 sub HelpMessage {