]> err.no Git - pwstore/commitdiff
Allow passing extra args to gpg
authorTollef Fog Heen <tfheen@err.no>
Tue, 25 Feb 2014 12:41:21 +0000 (13:41 +0100)
committerTollef Fog Heen <tfheen@err.no>
Tue, 25 Feb 2014 17:01:49 +0000 (18:01 +0100)
pws.rb

diff --git a/pws.rb b/pws.rb
index d69ec60aeaf2b4749ce633a98da26b1ab7d34a0b..1698451f6aabd7c7fa3f19df3859a264c7f1fd99 100755 (executable)
--- a/pws.rb
+++ b/pws.rb
@@ -49,6 +49,11 @@ class GnuPG
   @@my_keys = nil
   @@my_fprs = nil
   @@keyid_fpr_mapping = {}
+  @@extra_args = []
+
+  def GnuPG.extra_args=(val)
+    @@extra_args = val
+  end
 
   def GnuPG.readwrite3(intxt, infd, stdoutfd, stderrfd, statusfd=nil)
     outtxt, stderrtxt, statustxt = ''
@@ -93,7 +98,7 @@ class GnuPG
       STDERR.reopen(errW)
       begin
         if do_status
-          exec(cmd, "--status-fd=#{statW.fileno}",  *args)
+          exec(cmd, "--status-fd=#{statW.fileno}", *@@extra_args, *args)
         else
           exec(cmd, *args)
         end