improved help text, handle empty wordlists
authorSteven Tobin <redacted>
Sat, 22 May 2021 16:44:39 +0000 (17:44 +0100)
committerSteven Tobin <redacted>
Sat, 22 May 2021 16:44:39 +0000 (17:44 +0100)
README.rst
setup.py
xkcdpass/xkcd_password.py

index 36a64fc98cb95b301699fd2ffc974cfdabed68f2..1fa89b609fa76e15065c5c2a2e0994a76da1e896 100644 (file)
@@ -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
index 095c2f96226930593e70fafa72fe7c5cea10fd3f..d7f910537cab466455c9fdb1ab5c3a7d57b3d916 100644 (file)
--- 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',
index af401c2dff7e9c5915e61b7a713b52d9509c5d92..cc862b4c09e90ddf3f6b0281afc936187f9150e6 100755 (executable)
@@ -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):
git clone https://git.99rst.org/PROJECT