From 3465c88b06b006e811b17572a1b3ddbef06f65a1 Mon Sep 17 00:00:00 2001 From: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com> Date: Fri, 19 Jul 2019 13:11:49 +0200 Subject: [PATCH] add --withCase to vanitygen cli (#1420) * add caseSensitive * with types * alphabetical order --- packages/app-accounts/src/vanitygen/cli.ts | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/packages/app-accounts/src/vanitygen/cli.ts b/packages/app-accounts/src/vanitygen/cli.ts index 1eb3cb7396..ea7e21c080 100644 --- a/packages/app-accounts/src/vanitygen/cli.ts +++ b/packages/app-accounts/src/vanitygen/cli.ts @@ -20,11 +20,17 @@ interface Best { mnemonic?: string; offset: number; seed?: Uint8Array; + withCase?: boolean; } -const { match, mnemonic, network, type } = yargs +const { match, mnemonic, network, type, withCase } = yargs .option('match', { - default: 'Test' + default: 'Test', + type: 'string' + }) + .option('mnemonic', { + default: false, + type: 'boolean' }) .option('network', { choices: ['substrate', 'polkadot', 'kusama'], @@ -34,8 +40,9 @@ const { match, mnemonic, network, type } = yargs choices: ['ed25519', 'sr25519'], default: 'sr25519' }) - .option('mnemonic', { - default: false + .option('withCase', { + default: false, + type: 'boolean' }) .argv; @@ -43,11 +50,11 @@ const INDICATORS = ['|', '/', '-', '\\']; const NUMBER_REGEX = new RegExp('(\\d+?)(?=(\\d{3})+(?!\\d)|$)', 'g'); const options: GeneratorOptions = { - match: `${match}`, + match, network, runs: 50, type: type as KeypairType, - withCase: true, + withCase, withHex: !mnemonic }; const startAt = Date.now();