MCPcopy Index your code
hub / github.com/abiosoft/ishell / NewWithReadline

Function NewWithReadline

ishell.go:83–101  ·  view source on GitHub ↗

NewWithReadline creates a new shell with a custom readline instance.

(rl *readline.Instance)

Source from the content-addressed store, hash-verified

81
82// NewWithReadline creates a new shell with a custom readline instance.
83func NewWithReadline(rl *readline.Instance) *Shell {
84 shell := &Shell{
85 rootCmd: &Cmd{},
86 reader: &shellReader{
87 scanner: rl,
88 prompt: rl.Config.Prompt,
89 multiPrompt: defaultMultiPrompt,
90 showPrompt: true,
91 buf: &bytes.Buffer{},
92 completer: readline.NewPrefixCompleter(),
93 },
94 writer: rl.Config.Stdout,
95 autoHelp: true,
96 }
97 shell.Actions = &shellActionsImpl{Shell: shell}
98 shell.progressBar = newProgressBar(shell)
99 addDefaultFuncs(shell)
100 return shell
101}
102
103// Start starts the shell but does not wait for it to stop.
104func (s *Shell) Start() {

Callers 1

NewWithConfigFunction · 0.85

Calls 2

newProgressBarFunction · 0.85
addDefaultFuncsFunction · 0.85

Tested by

no test coverage detected