mask db password

This commit is contained in:
Boshi Lian 2022-04-17 08:37:22 +00:00
parent f6ad52bb6e
commit ac04660939

View file

@ -5,6 +5,7 @@ import (
"io/ioutil"
"log"
"os"
"strings"
"github.com/jessevdk/go-flags"
"github.com/tg123/sshkey"
@ -214,7 +215,11 @@ func main() {
fmt.Println("[" + g.ShortDescription + "]")
for _, o := range g.Options() {
fmt.Printf("%v = %v", o.LongName, o.Value())
if strings.HasSuffix(o.LongName, "password") {
fmt.Printf("%v = %v", o.LongName, "******")
} else {
fmt.Printf("%v = %v", o.LongName, o.Value())
}
fmt.Println()
}
fmt.Println()