#!/usr/bin/env ruby require 'rubygems' gem 'gtk2applib', '~> 15.3' require 'gtk2applib' require 'gtk2passwordapp' if $options=~/-no-gui/ then puts "Warning: password will be shown." print "Salt:" salt = $stdin.gets.strip passwords = Gtk2Password::Passwords.new(salt) puts "Warning: selected passwords will be shown." print "Enter Account pattern:" pattern = Regexp.new( $stdin.gets.strip, Regexp::IGNORECASE ) passwords.accounts.each do |account| if account =~ pattern then password = passwords.password_of(account) puts "\t\"" + account + "\"\t\t" + password end end exit end program = Gtk2AppLib::Program.new( Gtk2Password::ABOUT ) begin Gtk2Password::App.new(program) rescue Exception $!.puts_bang! ensure program.finalize end