Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added vhs #1387

Merged
merged 1 commit into from
Oct 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions completers/vhs_completer/cmd/help.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var helpCmd = &cobra.Command{
Use: "help",
Short: "Help about any command",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(helpCmd).Standalone()
rootCmd.AddCommand(helpCmd)
}
21 changes: 21 additions & 0 deletions completers/vhs_completer/cmd/new.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var newCmd = &cobra.Command{
Use: "new",
Short: "Create a new tape file with example tape file contents and documentation",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(newCmd).Standalone()
rootCmd.AddCommand(newCmd)

carapace.Gen(rootCmd).PositionalCompletion(
carapace.ActionFiles(),
)
}
27 changes: 27 additions & 0 deletions completers/vhs_completer/cmd/root.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var rootCmd = &cobra.Command{
Use: "vhs",
Short: "Run a given tape file and generates its outputs.",
Long: "https://github.com/charmbracelet/vhs",
Run: func(cmd *cobra.Command, args []string) {},
}

func Execute() error {
return rootCmd.Execute()
}

func init() {
carapace.Gen(rootCmd).Standalone()
rootCmd.Flags().BoolP("help", "h", false, "help for vhs")
rootCmd.Flags().BoolP("version", "v", false, "version for vhs")

carapace.Gen(rootCmd).PositionalCompletion(
carapace.ActionFiles(".tape"),
)
}
24 changes: 24 additions & 0 deletions completers/vhs_completer/cmd/serve.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
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: "Start the VHS SSH server",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(serveCmd).Standalone()
serveCmd.Flags().StringP("host", "l", "0.0.0.0", "host to listen on")
serveCmd.Flags().IntP("port", "p", 1976, "port to listen on")
rootCmd.AddCommand(serveCmd)

carapace.Gen(serveCmd).FlagCompletion(carapace.ActionMap{
"port": net.ActionPorts(),
})
}
21 changes: 21 additions & 0 deletions completers/vhs_completer/cmd/validate.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var validateCmd = &cobra.Command{
Use: "validate",
Short: "Validate a glob file path and parses all the files to ensure they are valid without running them.",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(validateCmd).Standalone()
rootCmd.AddCommand(validateCmd)

carapace.Gen(validateCmd).PositionalAnyCompletion(
carapace.ActionFiles(".tape"),
)
}
7 changes: 7 additions & 0 deletions completers/vhs_completer/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package main

import "github.com/rsteube/carapace-bin/completers/vhs_completer/cmd"

func main() {
cmd.Execute()
}