Conversation
|
|
|
Thank you for your contribution! We've added this to our internal tracking system for review. Details on our contribution process can be found here: https://contributing.bitwarden.com/contributing/pull-requests/community-pr-process. |
SaintPatrck
left a comment
There was a problem hiding this comment.
Hi @Steve0x2a
Thank you for your contribution. Please sign the CLA so we can accept these changes.
| if (validatedArgs.uppercase) { | ||
| params.push('--uppercase'); | ||
| } | ||
| if (validatedArgs.lowercase === false) { | ||
| params.push('--noLowercase'); | ||
| if (validatedArgs.lowercase) { | ||
| params.push('--lowercase'); | ||
| } | ||
| if (validatedArgs.number === false) { | ||
| params.push('--noNumbers'); | ||
| if (validatedArgs.number) { | ||
| params.push('--number'); | ||
| } | ||
| if (validatedArgs.special === false) { | ||
| params.push('--noSpecial'); | ||
| if (validatedArgs.special) { | ||
| params.push('--special'); | ||
| } |
There was a problem hiding this comment.
true, so an explicit false is silently dropped instead of excluded. bw generate reinstates its default classes whenever none of the four flags is present, so {uppercase: false} still comes back with uppercase enabled. Could we default the three CLI-defaulted classes to true so an explicit exclusion actually holds?
| if (validatedArgs.uppercase) { | |
| params.push('--uppercase'); | |
| } | |
| if (validatedArgs.lowercase === false) { | |
| params.push('--noLowercase'); | |
| if (validatedArgs.lowercase) { | |
| params.push('--lowercase'); | |
| } | |
| if (validatedArgs.number === false) { | |
| params.push('--noNumbers'); | |
| if (validatedArgs.number) { | |
| params.push('--number'); | |
| } | |
| if (validatedArgs.special === false) { | |
| params.push('--noSpecial'); | |
| if (validatedArgs.special) { | |
| params.push('--special'); | |
| } | |
| if (validatedArgs.uppercase ?? true) { | |
| params.push('--uppercase'); | |
| } | |
| if (validatedArgs.lowercase ?? true) { | |
| params.push('--lowercase'); | |
| } | |
| if (validatedArgs.number ?? true) { | |
| params.push('--number'); | |
| } | |
| if (validatedArgs.special) { | |
| params.push('--special'); | |
| } |
handleGeneratenow maps character-class booleans to the CLI's opt-in flags (--uppercase,--lowercase,--number,--special) instead of emitting unregistered--no*options.Credit: @WhimsicalCat
Fixes #223