From b6a59c90cf1dec282cd8e7d039ef6005614b21ca Mon Sep 17 00:00:00 2001 From: Jeromy Date: Thu, 2 Oct 2014 06:14:38 +0000 Subject: [PATCH] add flag for ipfs mountpoint --- cmd/ipfs/mount_unix.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/ipfs/mount_unix.go b/cmd/ipfs/mount_unix.go index 2f7e623f0..e37400e11 100644 --- a/cmd/ipfs/mount_unix.go +++ b/cmd/ipfs/mount_unix.go @@ -32,6 +32,7 @@ var cmdIpfsMount = &commander.Command{ func init() { cmdIpfsMount.Flag.String("n", "", "specify a mountpoint for ipns") + cmdIpfsMount.Flag.String("f", "/ipfs", "specify a mountpoint for ipfs") } func mountCmd(c *commander.Command, inp []string) error { @@ -69,12 +70,12 @@ func mountCmd(c *commander.Command, inp []string) error { go dl.Listen() defer dl.Close() - mp := inp[0] + mp := c.Flag.Lookup("f").Value.Get().(string) fmt.Printf("Mounting at %s\n", mp) var ipnsDone chan struct{} ns, ok := c.Flag.Lookup("n").Value.Get().(string) - if ok { + if ok && ns != "" { ipnsDone = make(chan struct{}) go func() { err = ipns.Mount(n, ns, mp)