mirror of
https://github.com/sbrow/envr.git
synced 2025-12-29 23:47:39 -05:00
refactor: Rewrote in golang.
This commit is contained in:
26
cmd/nushell_completion.go
Normal file
26
cmd/nushell_completion.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
_ "embed"
|
||||
"fmt"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
//go:embed mod.nu
|
||||
var completion string
|
||||
|
||||
// nushellCompletionCmd represents the nushellCompletion command
|
||||
var nushellCompletionCmd = &cobra.Command{
|
||||
Use: "nushell-completion",
|
||||
Short: "Generate custom completions for nushell",
|
||||
Long: `At time of writing, cobra does not natively support nushell,
|
||||
so a custom command had to be written`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
fmt.Println(completion)
|
||||
},
|
||||
}
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(nushellCompletionCmd)
|
||||
}
|
||||
Reference in New Issue
Block a user