File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ func main() {
3333 Username : cmds .Username ,
3434 }
3535
36- password := ui .GetPassword ()
36+ password := ui .GetPassword ("Current password of user " + s . Username + ": " )
3737
3838 settings .Runner .Run (s , password )
3939}
Original file line number Diff line number Diff line change @@ -10,8 +10,8 @@ import (
1010)
1111
1212// GetPassword reads a password from the terminal.
13- func GetPassword () string {
14- fmt .Print ("Password: " )
13+ func GetPassword (prompt string ) string {
14+ fmt .Print (prompt )
1515 passwordBytes , err := terminal .ReadPassword (int (syscall .Stdin ))
1616 fmt .Print ("\n " )
1717
Original file line number Diff line number Diff line change @@ -25,8 +25,11 @@ func (c *createCommand) Execute(args []string) error {
2525}
2626
2727func (c * createCommand ) Run (s settings.Settings , password string ) {
28+ newPassword := ui .GetPassword ("New password of user " + c .Arguments .Name + ": " )
29+
2830 data := map [string ]interface {}{
2931 "name" : c .Arguments .Name ,
32+ "password" : newPassword ,
3033 "matrix_id" : c .Arguments .MatrixID ,
3134 }
3235
You can’t perform that action at this time.
0 commit comments