Skip to content
This repository has been archived by the owner on Sep 12, 2018. It is now read-only.

Add a very basic gpg script. #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions bin/gpg
Original file line number Diff line number Diff line change
@@ -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)