#!/usr/bin/env ruby
# $Id: showpassword,v 1.1 2004/04/28 13:18:19 eto Exp $
# Copyright (C) 2003-2004 Kouichirou Eto, All rights reserved.
# This is free software with ABSOLUTELY NO WARRANTY.
# You can redistribute it and/or modify it under the terms of the GNU GPL2.

base = File.dirname(__FILE__)+"/.."
$LOAD_PATH.unshift(File.expand_path(base+'/lib'))
$LOAD_PATH.unshift(File.expand_path(base+'/compat'))

require 'qwik/ext_member'
require 'qwik/config'

def main(argv)
  if argv.length == 0
    puts "usage: showpassword [mailaddress]"
    exit
  end

  config = Qwik::Config.new
  gen = Qwik::PasswordGenerator.new(config)
  mail = argv.shift
  pass = gen.generate(mail)
  puts "mail: "+mail
  puts "pass: "+pass
end
main(ARGV)
