From: Steven Tobin Date: Sat, 22 May 2021 16:44:39 +0000 (+0100) Subject: improved help text, handle empty wordlists X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=b303e4e7dc06263c70d2eaac2b7d41cd07533d74;p=redacted-XKCD-password-generator.git improved help text, handle empty wordlists --- diff --git a/README.rst b/README.rst index 36a64fc..1fa89b6 100644 --- a/README.rst +++ b/README.rst @@ -193,6 +193,7 @@ or setting the appropriate environment variable:: Changelog ========= +- **1.19.1** Improvements to help text, handle rare case where arguments lead to empty wordlist - **1.19.0** Initial support for multiple wordfiles - **1.18.2** fixes for README - **1.18.0** Added randomised delimiters @@ -209,7 +210,6 @@ Changelog - **1.16.2** Fix exception on UTF8 open with python 2.x - **1.16.1** Fix encoding issue on Windows - **1.16.0** Case of words in passphrase can now be set using `--case` -- **1.15.1** Added more information about supported languages License diff --git a/setup.py b/setup.py index 095c2f9..d7f9105 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ import sys setup( name='xkcdpass', - version='1.19.0', + version='1.19.1', author='Steven Tobin', author_email='steventtobin@gmail.com', url='https://github.com/redacted/XKCD-password-generator', diff --git a/xkcdpass/xkcd_password.py b/xkcdpass/xkcd_password.py index af401c2..cc862b4 100755 --- a/xkcdpass/xkcd_password.py +++ b/xkcdpass/xkcd_password.py @@ -138,8 +138,10 @@ def generate_wordlist(wordfile=None, thisword = line.strip() if regexp.match(thisword) is not None: words.add(thisword) - - return list(words) # deduplicate, just in case + if len(words): + return list(words) # deduplicate, just in case + else: + raise SystemExit("Error: provided arguments result in zero-length wordlist, exiting.") def wordlist_to_worddict(wordlist):