From 8e4a42aa429c6dec0d5face7c69554d8a0677e96 Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Wed, 7 Oct 2020 16:58:53 +0200 Subject: short-name aliasing Add support for short-name aliasing. Signed-off-by: Valentin Rothberg --- vendor/github.com/chzyer/readline/password.go | 33 +++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 vendor/github.com/chzyer/readline/password.go (limited to 'vendor/github.com/chzyer/readline/password.go') diff --git a/vendor/github.com/chzyer/readline/password.go b/vendor/github.com/chzyer/readline/password.go new file mode 100644 index 000000000..414288c2a --- /dev/null +++ b/vendor/github.com/chzyer/readline/password.go @@ -0,0 +1,33 @@ +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, + } +} -- cgit v1.2.3-54-g00ecf