From 043e03f7239d62085cbe337e1761b23a57432974 Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Sun, 19 Jan 2014 18:35:31 +0000 Subject: [PATCH] Add a very basic gpg script. --- bin/gpg | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 bin/gpg diff --git a/bin/gpg b/bin/gpg new file mode 100755 index 0000000..f539aa8 --- /dev/null +++ b/bin/gpg @@ -0,0 +1,20 @@ +#!/usr/bin/env ruby +$:.unshift(File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))) + +require 'openpgp' +require 'openpgp/client/gnupg' +require 'optparse' + +client = OpenPGP::Client::GnuPG.new + +command = :help +options = {} +optparser = OptionParser.new do |opts| + client.methods.each do |meth| + opts.on("--" + meth.to_s.gsub("_", "-")) do + command = meth + end + end +end.parse! + +client.method(command).call(*ARGV)