Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Ohmyzsh
Commits
076f7f1e
Commit
076f7f1e
authored
Dec 14, 2020
by
Marc Cornellà
Browse files
fix(genpass): warn if no wordlist is found
parent
619097cc
Changes
1
Hide whitespace changes
Inline
Side-by-side
plugins/genpass/genpass.plugin.zsh
View file @
076f7f1e
...
...
@@ -73,7 +73,7 @@ genpass-monkey() {
genpass-xkcd
()
{
# Generates a 128-bit XKCD-style passphrase
#
EG
, 9-mien-flood-Patti-buxom-dozes-ickier-pay-ailed-Foster
#
e.g
, 9-mien-flood-Patti-buxom-dozes-ickier-pay-ailed-Foster
# Can take a numerical argument for generating extra passwords
if
((
!
$+
commands[shuf]
))
;
then
...
...
@@ -81,6 +81,11 @@ genpass-xkcd() {
return
1
fi
if
[[
!
-e
/usr/share/dict/words
]]
;
then
echo
>
&2
"
$0
: no wordlist found in
\`
/usr/share/dict/words
\`
. Install one first."
return
1
fi
local
-i
i num
[[
$1
=
~
'^[0-9]+$'
]]
&&
num
=
$1
||
num
=
1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment