From 6ffc295be9d2f7a95ea1e76a3fafc7789fbe3800 Mon Sep 17 00:00:00 2001 From: Luckymee Date: Thu, 30 Sep 2021 01:09:32 +1000 Subject: [PATCH] Implemented capitalize, and includeNumber (#369) * Implemented capitalize, and includeNumber - generate passphrase. Co-authored-by: davidrenzella * Capitalize shorthand flag * Update package.json * Remove accidental space Co-authored-by: davidrenzella Co-authored-by: govjmal --- src/commands/generate.command.ts | 2 ++ src/program.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/commands/generate.command.ts b/src/commands/generate.command.ts index 984f0a4225..933fe6eced 100644 --- a/src/commands/generate.command.ts +++ b/src/commands/generate.command.ts @@ -18,6 +18,8 @@ export class GenerateCommand { type: cmdOptions.passphrase ? 'passphrase' : 'password', wordSeparator: cmdOptions.separator == null ? '-' : cmdOptions.separator, numWords: cmdOptions.words || 3, + capitalize: cmdOptions.capitalize || false, + includeNumber: cmdOptions.includeNumber || false, }; if (!options.uppercase && !options.lowercase && !options.special && !options.number) { options.lowercase = true; diff --git a/src/program.ts b/src/program.ts index 8dceaa5618..6656bbc3e2 100644 --- a/src/program.ts +++ b/src/program.ts @@ -246,6 +246,8 @@ export class Program extends BaseProgram { .option('--length ', 'Length of the password.') .option('--words ', 'Number of words.') .option('--separator ', 'Word separator.') + .option('-c, --capitalize', 'Title case passphrase.') + .option('--includeNumber', 'Passphrase includes number.') .on('--help', () => { writeLn('\n Notes:'); writeLn('');