forgot connect.go

This commit is contained in:
Barak Michener 2018-03-31 18:03:37 -07:00
parent 61b665af13
commit b07acdf5c8

28
cmd/kubelwagen/connect.go Normal file
View file

@ -0,0 +1,28 @@
package main
import (
"os"
"github.com/barakmich/kubelwagen/client"
"github.com/spf13/cobra"
)
func init() {
rootCmd.AddCommand(connectCmd)
}
var connectCmd = &cobra.Command{
Use: "connect HOSTPORT DIR",
Short: "Mount DIR to the FUSE kubelwagen at HOSTPORT",
Run: connectRun,
}
func connectRun(cmd *cobra.Command, args []string) {
if len(args) != 2 {
cmd.Usage()
os.Exit(1)
}
hostport := args[0]
dir := args[1]
client.Connect(hostport, dir)
}