## Flags
- `--words`: path to a word list file where each word is delimited by a newline. Default value is `./words/xkcd.txt`.
-- `--separator`: string to insert in between each word in the output. Default value is `-`.
+- `--separator`: a character to insert in between each word in the output. If multiple characters are provided, a random character is picked for each separator. Default value is `-`.
- `--length`: the number of words to output. Default value is `3`.
## Included word lists
.then(f => dictionary.push(...f.split(/\r?\n/)))
.catch(abort); // Will throw if an invalid file path is given
+// Validate and process separator argument
+const separators: string[] = separator.toString().split('');
+
// Validate and process length argument
const len = parseInt(length);
if (isNaN(len)) {
crypto.getRandomValues(rand);
const output: string[] = [];
-rand.forEach(v => output.push(dictionary[v % dictionary.length]));
+rand.forEach(v => {
+ output.push(dictionary[v % dictionary.length]);
+ output.push(separators[v % separators.length]);
+});
+output.pop();
-console.log(output.join(separator));
+console.log(output.join(''));