Source File
snippet.go
Belonging Package
github.com/carapace-sh/carapace/internal/shell/elvish
// Package elvish provides elvish completionpackage elvishimport ()// Snippet creates the elvish completion script.func ( *cobra.Command) string {:= fmt.Sprintf(`set edit:completion:arg-completer[%v] = {|@arg|%v _carapace elvish (all $arg) | from-json | each {|completion|put $completion[Messages] | all (one) | each {|m|edit:notify (styled "error: " red)$m}if (not-eq $completion[Usage] "") {edit:notify (styled "usage: " $completion[DescriptionStyle])$completion[Usage]}put $completion[Candidates] | all (one) | peach {|c|if (eq $c[Description] "") {edit:complex-candidate $c[Value] &display=(styled $c[Display] $c[Style]) &code-suffix=$c[CodeSuffix]} else {edit:complex-candidate $c[Value] &display=(styled $c[Display] $c[Style])(styled " " $completion[DescriptionStyle]" bg-default")(styled "("$c[Description]")" $completion[DescriptionStyle]) &code-suffix=$c[CodeSuffix]}}}}`, .Name(), uid.Executable())if runtime.GOOS == "windows" {+= fmt.Sprintf("set edit:completion:arg-completer[%v.exe] = $edit:completion:arg-completer[%v]\n", .Name(), .Name())}return}
![]() |
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. |