-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
2 changed files
with
43 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,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 | ||
} |
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/tmate_completer/cmd" | ||
|
||
func main() { | ||
cmd.Execute() | ||
} |