forked from bazil/bolt-mount
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
38 lines (31 loc) · 631 Bytes
/
main.go
File metadata and controls
38 lines (31 loc) · 631 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package main
import (
"flag"
"fmt"
"log"
"os"
"path/filepath"
)
var progName = filepath.Base(os.Args[0])
func usage() {
fmt.Fprintf(os.Stderr, "Usage of %s:\n", progName)
fmt.Fprintf(os.Stderr, " %s DBPATH MOUNTPOINT\n", progName)
fmt.Fprintf(os.Stderr, "\n")
fmt.Fprintf(os.Stderr, " DBPATH will be created if it does not exist.\n")
fmt.Fprintf(os.Stderr, "\n")
flag.PrintDefaults()
}
func main() {
log.SetFlags(0)
log.SetPrefix(progName + ": ")
flag.Usage = usage
flag.Parse()
if flag.NArg() != 2 {
usage()
os.Exit(2)
}
err := mount(flag.Arg(0), flag.Arg(1))
if err != nil {
log.Fatal(err)
}
}