MCPcopy Index your code
hub / github.com/smallstep/cli / ReadInput

Function ReadInput

utils/read.go:76–87  ·  view source on GitHub ↗

ReadInput from stdin if something is detected or ask the user for an input using the given prompt.

(prompt string)

Source from the content-addressed store, hash-verified

74// ReadInput from stdin if something is detected or ask the user for an input
75// using the given prompt.
76func ReadInput(prompt string) ([]byte, error) {
77 st, err := stdin.Stat()
78 if err != nil {
79 return nil, errors.Wrap(err, "error reading data")
80 }
81
82 if st.Size() == 0 && st.Mode()&os.ModeNamedPipe == 0 {
83 return ui.PromptPassword(prompt)
84 }
85
86 return ReadAll(stdin)
87}
88
89// ReadFile returns the contents of the file identified by name. It reads from
90// STDIN if name is a hyphen ("-").

Callers 11

base64ActionFunction · 0.92
verifyActionFunction · 0.92
signOpenActionFunction · 0.92
signSignActionFunction · 0.92
authDigestActionFunction · 0.92
authVerifyActionFunction · 0.92
boxSealActionFunction · 0.92
secretboxSealActionFunction · 0.92
hashActionFunction · 0.92
compareActionFunction · 0.92
TestReadInputFunction · 0.85

Calls 1

ReadAllFunction · 0.85

Tested by 1

TestReadInputFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…