diff --git a/cmd/caralint/cmd/root.go b/cmd/caralint/cmd/root.go index 5d900fb15b..6a108acaec 100644 --- a/cmd/caralint/cmd/root.go +++ b/cmd/caralint/cmd/root.go @@ -15,6 +15,9 @@ var rootCmd = &cobra.Command{ Use: "caralint", Short: "", Args: cobra.MinimumNArgs(1), + CompletionOptions: cobra.CompletionOptions{ + DisableDefaultCmd: true, + }, Run: func(cmd *cobra.Command, args []string) { exitCode := 0 for _, arg := range args { diff --git a/cmd/carapace/cmd/lazyInit.go b/cmd/carapace/cmd/lazyInit.go index c0fa4dbabe..c245f7a3e1 100644 --- a/cmd/carapace/cmd/lazyInit.go +++ b/cmd/carapace/cmd/lazyInit.go @@ -45,6 +45,14 @@ complete -c '%v' -f -a '(_carapace_lazy %v)'`, completer, completer, completer) return fmt.Sprintf(snippet, strings.Join(complete, "\n")) } +func nushell_lazy(completers []string) string { + snippet := make([]string, len(completers)) + for index, completer := range completers { + snippet[index] = fmt.Sprintf(`config set completion.%v [carapace %v nushell _]`, completer, completer) + } + return strings.Join(snippet, "\n") +} + func oil_lazy(completers []string) string { snippet := `_carapace_lazy() { source <(carapace $1 oil) diff --git a/cmd/carapace/cmd/root.go b/cmd/carapace/cmd/root.go index cdb8be2ba4..0a25bbb0e8 100644 --- a/cmd/carapace/cmd/root.go +++ b/cmd/carapace/cmd/root.go @@ -68,6 +68,8 @@ var rootCmd = &cobra.Command{ fmt.Println(elvish_lazy(completers)) case "fish": fmt.Println(fish_lazy(completers)) + case "nushell": + fmt.Println(nushell_lazy(completers)) case "oil": fmt.Println(oil_lazy(completers)) case "powershell": diff --git a/docker-compose.yml b/docker-compose.yml index 4cc88925f0..bc2e2025fd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: '3' services: build: &base - image: ghcr.io/rsteube/carapace:v0.8.9 + image: ghcr.io/rsteube/carapace:v0.8.11 command: sh -c 'sh -c "cd /carapace-bin/cmd/carapace && go generate ./... && go build -ldflags=\"-s -w\" ."' environment: TARGET: /carapace-bin/cmd/carapace/carapace diff --git a/go.mod b/go.mod index 7d76656b5d..cd89d0d06f 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/mitchellh/go-homedir v1.1.0 github.com/mitchellh/go-ps v1.0.0 github.com/pelletier/go-toml v1.9.3 - github.com/rsteube/carapace v0.8.9 + github.com/rsteube/carapace v0.8.11 github.com/spf13/cobra v1.2.1 github.com/spf13/pflag v1.0.5 golang.org/x/sys v0.0.0-20210510120138-977fb7262007 diff --git a/go.sum b/go.sum index cf64e1ca95..2ccbcc5f0e 100644 --- a/go.sum +++ b/go.sum @@ -205,8 +205,8 @@ github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndr github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rsteube/carapace v0.8.9 h1:SQPuHcXftpdLdXn9Q43uNwqJWtAV9zfsxaNnVEUgtPI= -github.com/rsteube/carapace v0.8.9/go.mod h1:vDNOn5K8QzGAqLTSA6WcUVvoUR5jRDcBxxQIAbv2XzY= +github.com/rsteube/carapace v0.8.11 h1:XYdIE3mvlx7X9k7PaGPGvxYEBRF5qYZtzUG9hDd6PA8= +github.com/rsteube/carapace v0.8.11/go.mod h1:vDNOn5K8QzGAqLTSA6WcUVvoUR5jRDcBxxQIAbv2XzY= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=