carve out cmd, stub server impl
This commit is contained in:
parent
51fa79ef2f
commit
90aa93a1d7
64 changed files with 10564 additions and 3 deletions
|
|
@ -1,6 +1,10 @@
|
|||
package main
|
||||
|
||||
import "github.com/spf13/cobra"
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var rootCmd = &cobra.Command{
|
||||
Use: "kubelwagen",
|
||||
|
|
@ -9,4 +13,7 @@ var rootCmd = &cobra.Command{
|
|||
Run: rootRun,
|
||||
}
|
||||
|
||||
func rootRun(cmd *cobra.Command)
|
||||
func rootRun(cmd *cobra.Command, args []string) {
|
||||
cmd.Usage()
|
||||
os.Exit(1)
|
||||
}
|
||||
|
|
|
|||
31
cmd/kubelwagen/serve.go
Normal file
31
cmd/kubelwagen/serve.go
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var (
|
||||
hostport string
|
||||
)
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(serveCmd)
|
||||
serveCmd.PersistentFlags().StringVar(&hostport, "listen", "0.0.0.0:8889", "Host and port to listen on")
|
||||
}
|
||||
|
||||
var serveCmd = &cobra.Command{
|
||||
Use: "serve DIR",
|
||||
Short: "Create a FUSE mount at DIR",
|
||||
Run: serveRun,
|
||||
}
|
||||
|
||||
func serveRun(cmd *cobra.Command, args []string) {
|
||||
if len(args) != 1 {
|
||||
cmd.Usage()
|
||||
os.Exit(1)
|
||||
}
|
||||
dir := args[0]
|
||||
kubelwagen.Serve(hostport, dir)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue