Skip to content

Commit

Permalink
More polish
Browse files Browse the repository at this point in the history
  • Loading branch information
hanwen committed Apr 24, 2012
1 parent f193501 commit 10979ac
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions main.go
Expand Up @@ -2,13 +2,10 @@ package main
import (
"flag"
"log"
"runtime"
"github.com/hanwen/go-fuse/fuse"
)

func main() {
runtime.LockOSThread()

fsdebug := flag.Bool("fs-debug", false, "switch on FS debugging")
mtpDebug := flag.Int("mtp-debug", 0, "switch on MTP debugging")
flag.Parse()
Expand All @@ -27,9 +24,13 @@ func main() {
for _, d := range devs {
log.Printf("device %v: ", d)
}
if len(devs) != 1 {
if len(devs) == 0 {
log.Fatal("no device found. Try replugging it.")
}
if len(devs) > 1 {
log.Fatal("must have exactly one device")
}

rdev := devs[0]

dev, err := rdev.Open()
Expand Down Expand Up @@ -59,7 +60,7 @@ func main() {

conn.Debug = *fsdebug
mount.Debug = *fsdebug
log.Println("starting FUSE loop")
log.Println("starting FUSE.")
mount.Loop()
}

0 comments on commit 10979ac

Please sign in to comment.