mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-29 10:21:01 -06:00
aa6dca4912
This new version includes Solaris support, the lack of which previously caused us to disable readline-using features ("terraform console") on Solaris builds.
34 lines
630 B
Go
34 lines
630 B
Go
package readline
|
|
|
|
type opPassword struct {
|
|
o *Operation
|
|
backupCfg *Config
|
|
}
|
|
|
|
func newOpPassword(o *Operation) *opPassword {
|
|
return &opPassword{o: o}
|
|
}
|
|
|
|
func (o *opPassword) ExitPasswordMode() {
|
|
o.o.SetConfig(o.backupCfg)
|
|
o.backupCfg = nil
|
|
}
|
|
|
|
func (o *opPassword) EnterPasswordMode(cfg *Config) (err error) {
|
|
o.backupCfg, err = o.o.SetConfig(cfg)
|
|
return
|
|
}
|
|
|
|
func (o *opPassword) PasswordConfig() *Config {
|
|
return &Config{
|
|
EnableMask: true,
|
|
InterruptPrompt: "\n",
|
|
EOFPrompt: "\n",
|
|
HistoryLimit: -1,
|
|
Painter: &defaultPainter{},
|
|
|
|
Stdout: o.o.cfg.Stdout,
|
|
Stderr: o.o.cfg.Stderr,
|
|
}
|
|
}
|