fix dep, impl nonempty

This commit is contained in:
Barak Michener 2018-03-30 19:36:37 -07:00
parent c8c18403e4
commit a5d237df2a
24 changed files with 286 additions and 215 deletions

View file

@ -10,11 +10,15 @@ import (
var (
hostport string
nonempty bool
readonly bool
)
func init() {
rootCmd.AddCommand(serveCmd)
serveCmd.PersistentFlags().StringVar(&hostport, "listen", "0.0.0.0:8889", "Host and port to listen on")
serveCmd.PersistentFlags().BoolVar(&nonempty, "nonempty", false, "Allow mounting over a nonempty directory (default behavior in libfuse 3.x)")
serveCmd.PersistentFlags().BoolVar(&readonly, "readonly", false, "Mount read-only")
}
var serveCmd = &cobra.Command{
@ -29,5 +33,9 @@ func serveRun(cmd *cobra.Command, args []string) {
os.Exit(1)
}
dir := args[0]
kubelwagen.Serve(hostport, dir)
opts := &kubelwagen.WsFsOpts{
ReadOnly: readonly,
NonEmpty: nonempty,
}
kubelwagen.Serve(hostport, dir, opts)
}