Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
kardolus
GitHub Repository: kardolus/chatgpt-cli
Path: blob/main/vendor/github.com/chzyer/readline/password.go
2875 views
1
package readline
2
3
type opPassword struct {
4
o *Operation
5
backupCfg *Config
6
}
7
8
func newOpPassword(o *Operation) *opPassword {
9
return &opPassword{o: o}
10
}
11
12
func (o *opPassword) ExitPasswordMode() {
13
o.o.SetConfig(o.backupCfg)
14
o.backupCfg = nil
15
}
16
17
func (o *opPassword) EnterPasswordMode(cfg *Config) (err error) {
18
o.backupCfg, err = o.o.SetConfig(cfg)
19
return
20
}
21
22
func (o *opPassword) PasswordConfig() *Config {
23
return &Config{
24
EnableMask: true,
25
InterruptPrompt: "\n",
26
EOFPrompt: "\n",
27
HistoryLimit: -1,
28
Painter: &defaultPainter{},
29
30
Stdout: o.o.cfg.Stdout,
31
Stderr: o.o.cfg.Stderr,
32
}
33
}
34
35