zenity/pwd_unix.go

18 lines
395 B
Go
Raw Normal View History

2022-03-24 10:37:37 -04:00
//go:build !windows && !darwin
2021-04-08 20:26:57 -04:00
package zenity
2022-05-11 12:49:15 -04:00
import "github.com/ncruces/zenity/internal/zenutil"
2021-04-08 20:26:57 -04:00
2021-04-29 11:05:28 -04:00
func password(opts options) (string, string, error) {
2021-04-08 20:26:57 -04:00
args := []string{"--password"}
args = appendTitle(args, opts)
args = appendButtons(args, opts)
if opts.username {
args = append(args, "--username")
}
out, err := zenutil.Run(opts.ctx, args)
2022-05-11 12:49:15 -04:00
return pwdResult("|", opts, out, err)
2021-04-08 20:26:57 -04:00
}