Add --logfile argument
authorMarius Gavrilescu <marius@ieval.ro>
Tue, 8 Jul 2014 07:04:18 +0000 (10:04 +0300)
committerMarius Gavrilescu <marius@ieval.ro>
Tue, 8 Jul 2014 07:04:18 +0000 (10:04 +0300)
edwardng
lib/App/EdwardNG.pm

index 4f6124eb02a9e0e5acf844ee31ced84a970a1925..090a93766a35803029d0459e8215f026f2a4eaf8 100755 (executable)
--- a/edwardng
+++ b/edwardng
@@ -20,7 +20,7 @@ Manually:
 
 In F</etc/aliases>:
 
-  edwardng: |edwardng --from=edwardng@example.org --key=12345678
+  edwardng: |edwardng --from=edwardng@example.org --key=12345678 --keydir=/srv/edwardng-keydir --debug --logfile=/var/log/edwardng
 
 =head1 DESCRIPTION
 
@@ -52,6 +52,10 @@ ID of key used for encrypting replies.
 
 Path to GnuPG homedir.
 
+=item B<--logfile>=I</path/to/logfile>
+
+If B<--debug>, append debug information to this file. Ignored if B<--no-debug>.
+
 =item B<--passphrase>=I<passphrase>
 
 Private key passphrase.
@@ -92,6 +96,10 @@ Corresponds to B<--key>.
 
 Corresponds to B<--keydir>.
 
+=item EDWARDNG_LOGFILE
+
+Corresponds to B<--logfile>.
+
 =item EDWARDNG_PASSPHRASE
 
 Corresponds to B<--passphrase>.
index 4da1968ce2ab082321fc2ea5b334252f2ee6767e..8343b473d0731756366bfe7761a3ca8e3a10202c 100644 (file)
@@ -96,11 +96,13 @@ sub run {
                'from=s'        => \$ENV{EDWARDNG_FROM},
                'key=s'         => \$ENV{EDWARDNG_KEY},
                'keydir=s'      => \$ENV{EDWARDNG_KEYDIR},
+               'logfile=s'     => \$ENV{EDWARDNG_LOGFILE},
                'passphrase=s'  => \$ENV{EDWARDNG_PASSPHRASE},
                'tmpl-path=s'   => \$ENV{EDWARDNG_TMPL_PATH},
                'use-agent!'    => \$ENV{EDWARDNG_USE_AGENT},
        );
        my $tmpl_path = $ENV{EDWARDNG_TMPL_PATH} // 'en';
+       open STDERR, '>>', $ENV{EDWARDNG_LOGFILE} if $ENV{EDWARDNG_LOGFILE};
 
        my $parser = MIME::Parser->new;
        $parser->decode_bodies(0);
This page took 0.011768 seconds and 4 git commands to generate.