From: Tollef Fog Heen Date: Tue, 25 Feb 2014 12:41:21 +0000 (+0100) Subject: Allow passing extra args to gpg X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e8213476b02e7a954b3cd6306dd3eac74ba22df;p=pwstore Allow passing extra args to gpg --- diff --git a/pws.rb b/pws.rb index d69ec60..1698451 100755 --- 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