#!/usr/bin/env python
import argparse
import sys

from hashauthenticator import generate_password_digest

if __name__ == '__main__':
  parser = argparse.ArgumentParser(description='Show the password for a user')
  parser.add_argument('username', help='Username for JupyterHub')
  parser.add_argument('secret_key', nargs='?', help='Salt for the hash', default='')
  parser.add_argument('--length', '-l', type=int, help='Password length', default=6)
  args = parser.parse_args()

  print(generate_password_digest(args.username, args.secret_key, args.length))
