Skip to content

Commit

Permalink
added tmate
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Apr 27, 2022
1 parent 2e9fe58 commit 74c07af
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
36 changes: 36 additions & 0 deletions completers/tmate_completer/cmd/root.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package cmd

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

var rootCmd = &cobra.Command{
Use: "tmate",
Short: "Instant terminal sharing",
Long: "https://tmate.io/",
Run: func(cmd *cobra.Command, args []string) {},
}

func Execute() error {
return rootCmd.Execute()
}
func init() {
carapace.Gen(rootCmd).Standalone()

rootCmd.Flags().BoolS("F", "F", false, "set the foreground mode, useful for setting remote access")
rootCmd.Flags().StringS("S", "S", "", "set the socket path, useful to issue commands to a running tmate instance")
rootCmd.Flags().BoolS("V", "V", false, "print version")
rootCmd.Flags().StringS("f", "f", "", "set the config file path")
rootCmd.Flags().StringS("k", "k", "", "specify an api-key, necessary for using named sessions on tmate.io")
rootCmd.Flags().StringS("n", "n", "", "specify the session token instead of getting a random one")
rootCmd.Flags().StringS("r", "r", "", "same, but for the read-only token")
rootCmd.Flags().BoolS("v", "v", false, "set verbosity (can be repeated)")

carapace.Gen(rootCmd).FlagCompletion(carapace.ActionMap{
"S": carapace.ActionFiles(),
"f": carapace.ActionFiles(),
})

// TODO tmux commnds
}
7 changes: 7 additions & 0 deletions completers/tmate_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/tmate_completer/cmd"

func main() {
cmd.Execute()
}

0 comments on commit 74c07af

Please sign in to comment.