Browse Source

Implemented capitalize, and includeNumber (#369)

* Implemented capitalize, and includeNumber - generate passphrase.

Co-authored-by: davidrenzella <david.renzella@gmail.com>

* Capitalize shorthand flag

* Update package.json

* Remove accidental space

Co-authored-by: davidrenzella <david.renzella@gmail.com>
Co-authored-by: govjmal <govjmal@gmail.com>
pull/382/head
Luckymee 4 years ago committed by GitHub
parent
commit
6ffc295be9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/commands/generate.command.ts
  2. 2
      src/program.ts

2
src/commands/generate.command.ts

@ -18,6 +18,8 @@ export class GenerateCommand { @@ -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;

2
src/program.ts

@ -246,6 +246,8 @@ export class Program extends BaseProgram { @@ -246,6 +246,8 @@ export class Program extends BaseProgram {
.option('--length <length>', 'Length of the password.')
.option('--words <words>', 'Number of words.')
.option('--separator <separator>', 'Word separator.')
.option('-c, --capitalize', 'Title case passphrase.')
.option('--includeNumber', 'Passphrase includes number.')
.on('--help', () => {
writeLn('\n Notes:');
writeLn('');

Loading…
Cancel
Save