Source File
hint.go
Belonging Package
github.com/reeflective/readline/internal/completion
package completionimport ()func ( *Engine) ( Values) {:= ""// First add the command/flag usage string if any,// and only if we don't have completions.if len(.values) == 0 || .config.GetBool("usage-hint-always") {if .Usage != "" {+= color.Dim + .Usage + color.Reset + term.NewlineReturn}}// Add application-specific messages.// There is full support for color in them, but in case those messages// don't include any, we tame the color a little bit first, like hints.:= strings.Join(.Messages.Get(), term.NewlineReturn)= strings.TrimSuffix(, term.NewlineReturn)if != "" {= + color.Dim +}// If we don't have any completions, and no messages, let's say it.if .Matches() == 0 && == color.Dim+term.NewlineReturn && !.auto {= .hintNoMatches()}= strings.TrimSuffix(, term.NewlineReturn)if == "" {return}// Add the hint to the shell..hint.Set( + color.Reset)}func ( *Engine) () string {:= color.Dim + "no matching"var []stringfor , := range .groups {if .tag == "" {continue}= append(, .tag)}if len() > 0 {:= strings.Join(, ", ")+= "'" + + "'"}return + " completions"}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |