aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2015-09-03 23:54:12 +0200
committerJakob Unterwurzacher2015-09-03 23:54:12 +0200
commit6a110b8dde07a4bfa967547be8bf5b3756511a8b (patch)
tree045fd9015f0a83a38fafdfabd99cf5dde9d6d9df /main.go
parent4b98f74e3e875361436e57d870aed48c4bb44d77 (diff)
Mounts and show an empty dir
Diffstat (limited to 'main.go')
-rw-r--r--main.go17
1 files changed, 9 insertions, 8 deletions
diff --git a/main.go b/main.go
index 1183fec..a3159f3 100644
--- a/main.go
+++ b/main.go
@@ -18,11 +18,11 @@ import (
)
// debug flag enables logging of debug messages to stderr.
-var debug = flag.Bool("debug", false, "enable debug log messages to stderr")
+var debug = flag.Bool("debug", true, "enable debug log messages to stderr")
func usage() {
fmt.Fprintf(os.Stderr, "Usage of %s:\n", os.Args[0])
- fmt.Fprintf(os.Stderr, " %s MOUNTPOINT\n", os.Args[0])
+ fmt.Fprintf(os.Stderr, " %s BACKING MOUNTPOINT\n", os.Args[0])
flag.PrintDefaults()
}
@@ -34,18 +34,19 @@ func main() {
flag.Usage = usage
flag.Parse()
- if flag.NArg() != 1 {
+ if flag.NArg() != 2 {
usage()
os.Exit(2)
}
- mountpoint := flag.Arg(0)
+ backing := flag.Arg(0)
+ mountpoint := flag.Arg(1)
c, err := fuse.Mount(
mountpoint,
- fuse.FSName("memfs"),
- fuse.Subtype("memfs"),
+ fuse.FSName("gocryptfs"),
+ fuse.Subtype("gocryptfs"),
fuse.LocalVolume(),
- fuse.VolumeName("Memory FS"),
+ fuse.VolumeName("gocryptfs"),
)
if err != nil {
log.Fatal(err)
@@ -59,7 +60,7 @@ func main() {
srv := fs.New(c, cfg)
var key [16]byte
- filesys := frontend.New(key)
+ filesys := frontend.New(key, backing)
if err := srv.Serve(filesys); err != nil {
log.Fatal(err)