add flag for ipfs mountpoint
Jeromy committed
Oct 2, 2014 at 06:14 UTC
b6a59c90cf1dec282cd8e7d039ef6005614b21ca
1 file changed
+3
-2
cmd/ipfs/mount_unix.go
+3
-2
@@ -32,6 +32,7 @@ var cmdIpfsMount = &commander.Command{
32
33
func init() {
34
cmdIpfsMount.Flag.String("n", "", "specify a mountpoint for ipns")
35
+ cmdIpfsMount.Flag.String("f", "/ipfs", "specify a mountpoint for ipfs")
36
}
37
38
func mountCmd(c *commander.Command, inp []string) error {
@@ -69,12 +70,12 @@ func mountCmd(c *commander.Command, inp []string) error {
70
go dl.Listen()
71
defer dl.Close()
72
72
- mp := inp[0]
73
+ mp := c.Flag.Lookup("f").Value.Get().(string)
74
fmt.Printf("Mounting at %s\n", mp)
75
76
var ipnsDone chan struct{}
77
ns, ok := c.Flag.Lookup("n").Value.Get().(string)
77
- if ok {
78
+ if ok && ns != "" {
79
ipnsDone = make(chan struct{})
80
go func() {
81
err = ipns.Mount(n, ns, mp)