Skip to content

Commit f3e0c58

Browse files
committed
Return wordlist types
1 parent 67ad370 commit f3e0c58

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

lib/helpers/wordlist_helper.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,14 @@ def get_stdin_wordlist(self):
1616

1717
def get_wordlist(self, wordlist_files=None):
1818
wordlist = []
19+
wordlist_types = []
1920
stdin_words = self.get_stdin_wordlist()
21+
print(stdin_words)
2022
if stdin_words:
23+
wordlist_types.append('stdin')
2124
wordlist.extend(stdin_words)
2225
combined = get_combined_word_lists(wordlist_files or DEFAULT_WORDLIST_FILE)
23-
wordlist.extend(combined['words'])
24-
return wordlist
26+
if combined:
27+
wordlist_types.append('wordlists: {}'.format(', '.join(combined['file_paths'])))
28+
wordlist.extend(combined['words'])
29+
return wordlist, wordlist_types

tests/helpers/test_wordlist_helper.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ def test_get_wordlist_from_stdin(self):
2020
with patch('sys.stdin') as mock_stdin:
2121
mock_stdin.read = Mock(return_value='\n'.join(stdin_list))
2222
mock_stdin.isatty = Mock(return_value=False)
23-
self.assertEqual(self.wordlist.get_wordlist(), expected_wordlist)
23+
wordlist, wordlist_types = self.wordlist.get_wordlist()
24+
self.assertEqual(wordlist, expected_wordlist)
2425

2526
def test_using_default_wordlist(self):
26-
self.assertEqual(self.wordlist.get_wordlist(), self.default_wordlist)
27+
wordlist, wordlist_types = self.wordlist.get_wordlist()
28+
self.assertEqual(wordlist, self.default_wordlist)

0 commit comments

Comments
 (0)