-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/rsteube/carapace" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var inspectModuleCmd = &cobra.Command{ | ||
Use: "inspect-module", | ||
Short: "Lists available debug items", | ||
Run: func(cmd *cobra.Command, args []string) {}, | ||
} | ||
|
||
func init() { | ||
carapace.Gen(inspectModuleCmd).Standalone() | ||
inspectModuleCmd.Flags().BoolS("verbose", "verbose", false, "whether to enable verbose output") | ||
|
||
rootCmd.AddCommand(inspectModuleCmd) | ||
|
||
carapace.Gen(inspectModuleCmd).PositionalCompletion( | ||
carapace.ActionFiles(), | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/rsteube/carapace" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var rootCmd = &cobra.Command{ | ||
Use: "terraform-ls", | ||
Short: "Terraform Language Server", | ||
Long: "https://github.com/hashicorp/terraform-ls", | ||
Run: func(cmd *cobra.Command, args []string) {}, | ||
} | ||
|
||
func Execute() error { | ||
return rootCmd.Execute() | ||
} | ||
func init() { | ||
carapace.Gen(rootCmd).Standalone() | ||
|
||
rootCmd.Flags().BoolP("version", "v", false, "show version") | ||
rootCmd.PersistentFlags().BoolP("help", "h", false, "show help") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/rsteube/carapace" | ||
"github.com/rsteube/carapace-bin/pkg/actions/net" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var serveCmd = &cobra.Command{ | ||
Use: "serve", | ||
Short: "Starts the Language Server", | ||
Run: func(cmd *cobra.Command, args []string) {}, | ||
} | ||
|
||
func init() { | ||
carapace.Gen(serveCmd).Standalone() | ||
|
||
serveCmd.Flags().StringS("cpuprofile", "cpuprofile", "", "file into which to write CPU profile") | ||
serveCmd.Flags().StringS("log-file", "log-file", "", "path to a file to log into with support for variables") | ||
serveCmd.Flags().StringS("memprofile", "memprofile", "", "file into which to write memory profile") | ||
serveCmd.Flags().StringS("port", "port", "", "port number to listen on") | ||
serveCmd.Flags().StringS("req-concurrency", "req-concurrency", "", "number of RPC requests to process concurrently") | ||
rootCmd.AddCommand(serveCmd) | ||
|
||
carapace.Gen(serveCmd).FlagCompletion(carapace.ActionMap{ | ||
"cpuprofile": carapace.ActionFiles(), | ||
"log-file": carapace.ActionFiles(), | ||
"memprofile": carapace.ActionFiles(), | ||
"port": net.ActionPorts(), | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/rsteube/carapace" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var versionCmd = &cobra.Command{ | ||
Use: "version", | ||
Short: "Displays the version of the language server", | ||
Run: func(cmd *cobra.Command, args []string) {}, | ||
} | ||
|
||
func init() { | ||
carapace.Gen(versionCmd).Standalone() | ||
versionCmd.Flags().BoolS("json", "json", false, "output the version information as a JSON object") | ||
|
||
rootCmd.AddCommand(versionCmd) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package main | ||
|
||
import "github.com/rsteube/carapace-bin/completers/terraform-ls_completer/cmd" | ||
|
||
func main() { | ||
cmd.Execute() | ||
} |