Skip to content

Commit

Permalink
prompt MasterPassword when missing
Browse files Browse the repository at this point in the history
fixes #20
  • Loading branch information
edouard-lopez authored and sctfic committed May 2, 2019
1 parent 0193297 commit c24385a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Lesspass/Lesspass.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function Get-LessPass {
param(
[string]$site,
[string]$login,
[string]$master_password,
[string][Parameter(Mandatory=$true)]$master_password,
[Alias('l')][Switch]$lowercase,
[Alias('u')][Switch]$uppercase,
[Alias('d')][Switch]$digits,
Expand Down
4 changes: 4 additions & 0 deletions Lesspass/Lesspass.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,9 @@ Describe 'Get-LessPass' {
{Get-LessPass "site" "login" "masterpassword" -Length 2} `
| Should -Throw "Cannot validate argument on parameter 'length'. The 2 argument is less than the minimum allowed range"
}

It 'Prompt for MasterPassword when missing' {
(Get-Command Get-LessPass).Parameters['master_password'].Attributes.Mandatory | Should -Be $true
}
}
}

0 comments on commit c24385a

Please sign in to comment.