2 Commits

Author SHA1 Message Date
8657f3c13d add quotes to error messages
All checks were successful
continuous-integration/drone/tag Build is passing
2021-07-28 20:15:40 -07:00
93954add96 remove duplicate error message 2021-07-28 18:23:35 -07:00
2 changed files with 3 additions and 6 deletions

View File

@ -1,6 +1,6 @@
# Package
version = "0.3.0"
version = "0.3.1"
author = "Joseph Montanaro"
description = "Passphrase generator and dictionary builder"
license = "none"

View File

@ -33,9 +33,6 @@ const dict = loadWords()
proc genPassphrase(length, dictSize: int): string =
if dictSize < 100 or dictSize > dict.len:
quit("Dictionary size must be between 100 and " & $dict.len, 1)
var rands = newSeq[uint64](length)
discard randomBytes(rands)
@ -65,7 +62,7 @@ proc parseInput(): (int, int) =
try:
length = parseInt(params[0])
except ValueError:
quit(params[0] & " is not a valid passphrase length.", 1)
quit('"' & params[0] & "\" is not a valid passphrase length.", 1)
if params.len > 1:
try:
@ -73,7 +70,7 @@ proc parseInput(): (int, int) =
if dictSize < 100 or dictSize > dict.len:
quit("Dictionary size must be between 100 and " & $dict.len, 1)
except ValueError:
quit(params[1] & " is not a valid dictionary size.", 1)
quit('"' & params[1] & "\" is not a valid dictionary size.", 1)
result = (length, dictSize)