11#!/usr/bin/env python
2- # Diceware password generator in Python, in one tweet.
2+ #
3+ # The author disclaims copyright to this source code. In place of
4+ # a legal notice, here is a blessing:
5+ #
6+ # - May you do good and not evil.
7+ # - May you find forgiveness for yourself and forgive others.
8+ # - May you share freely, never taking more than you give.
9+ #
310import random , sys , getopt
411
512def main (argv ):
@@ -17,15 +24,29 @@ def main(argv):
1724 sys .exit (2 )
1825 for opt , arg in opts :
1926 if opt == '-h' :
20- print 'Usage: ./passphrase [options] [-n] <number of words>'
27+ print '# Version: diceware-password-generator 1.0.1'
28+ print '# Release Date: 18 March 2018'
29+ print '# Project: https://justin.hartman.me/projects/diceware-password-generator.html'
30+ print '#'
31+ print '# The author disclaims copyright to this source code. In place of'
32+ print '# a legal notice, here is a blessing:'
33+ print '#'
34+ print '# - May you do good and not evil.'
35+ print '# - May you find forgiveness for yourself and forgive others.'
36+ print '# - May you share freely, never taking more than you give.'
37+ print '#'
38+ print 'Usage: $ ./passphrase [options] [-n] <number of words>'
39+ print 'Options:'
2140 print '-w, --words Standard word list (default)'
2241 print '-v, --vorvig Vorvig word list'
2342 print '-s, --short Short, memorable word list'
2443 print '-e, --edit Short, editable word list. Experimental.'
25- print '-b, --beale Arnold Reinhold \' s Beale Diceware word list.'
44+ print '-b, --beale Beale Diceware word list.'
2645 print '--------------------------------------------------------'
2746 print '-n, --number Input an integer for the number of words'
2847 print ' you want generated for your passphrase.'
48+ print ''
49+ print 'Example: $ ./passphrase --words -n 4'
2950 sys .exit ()
3051 elif opt in ("-w" , "--words" ):
3152 p = words
0 commit comments