3 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
5793a18358 fix drone config
All checks were successful
continuous-integration/drone/tag Build is passing
2021-07-28 18:17:21 -07:00
3 changed files with 5 additions and 8 deletions

View File

@ -3,7 +3,7 @@ type: docker
name: main
trigger:
- tag
event: tag
steps:
- name: build-windows
@ -25,7 +25,7 @@ steps:
- build-windows
- build-linux
settings:
base_url: 'https://git.jfmonty2.com/jfmonty2/passphrase.git'
base_url: 'https://git.jfmonty2.com'
files:
- passphrase_linux
- passphrase.exe

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)