diff --git a/core/commands/active.go b/core/commands/active.go index fffdc4f60ca8..4fada6f1398f 100644 --- a/core/commands/active.go +++ b/core/commands/active.go @@ -1,6 +1,7 @@ package commands import ( + "bytes" "fmt" "io" "sort" @@ -8,7 +9,8 @@ import ( "time" oldcmds "github.com/ipfs/go-ipfs/commands" - cmds "gx/ipfs/QmRRovo1DE6i5cMjCbf19mQCSuszF6SKwdZNUMS7MtBnH1/go-ipfs-cmds" + + cmds "gx/ipfs/QmdTmGruUz23vgzym3uWpnAEQdGdGifQqBvP8UXSRjG8gZ/go-ipfs-cmds" cmdkit "gx/ipfs/Qmde5VP1qUkyQXKCfmEUA7bP64V2HAptbJ7phuPp7jXWwg/go-ipfs-cmdkit" ) @@ -38,7 +40,9 @@ Lists running and recently run commands. cmds.Text: cmds.MakeTypedEncoder(func(req *cmds.Request, w io.Writer, out *[]*cmds.ReqLogEntry) error { verbose, _ := req.Options[verboseOptionName].(bool) - tw := tabwriter.NewWriter(w, 4, 4, 2, ' ', 0) + buf := new(bytes.Buffer) + + tw := tabwriter.NewWriter(buf, 4, 4, 2, ' ', 0) if verbose { fmt.Fprint(tw, "ID\t") } @@ -74,9 +78,13 @@ Lists running and recently run commands. live = req.EndTime.Sub(req.StartTime) } t := req.StartTime.Format(time.Stamp) - fmt.Fprintf(w, "%t\t%s\t%s\n", req.Active, t, live) + fmt.Fprintf(tw, "%t\t%s\t%s\n", req.Active, t, live) } - return tw.Flush() + tw.Flush() + + fmt.Fprint(w, buf) + + return nil }), }, Type: []*cmds.ReqLogEntry{}, diff --git a/core/commands/config.go b/core/commands/config.go index b6a72013b9a5..30d1bb82acce 100644 --- a/core/commands/config.go +++ b/core/commands/config.go @@ -16,7 +16,7 @@ import ( "gx/ipfs/QmP2i47tnU23ijdshrZtuvrSkQPtf9HhsMb9fwGVe8owj2/jsondiff" config "gx/ipfs/QmPEpj17FDRpc7K1aArKZp3RsHtzRMKykeK9GVgn4WQGPR/go-ipfs-config" - cmds "gx/ipfs/QmRRovo1DE6i5cMjCbf19mQCSuszF6SKwdZNUMS7MtBnH1/go-ipfs-cmds" + cmds "gx/ipfs/QmdTmGruUz23vgzym3uWpnAEQdGdGifQqBvP8UXSRjG8gZ/go-ipfs-cmds" cmdkit "gx/ipfs/Qmde5VP1qUkyQXKCfmEUA7bP64V2HAptbJ7phuPp7jXWwg/go-ipfs-cmdkit" ) diff --git a/core/commands/diag.go b/core/commands/diag.go index f6f14b839493..b456b1f08432 100644 --- a/core/commands/diag.go +++ b/core/commands/diag.go @@ -1,7 +1,7 @@ package commands import ( - cmds "gx/ipfs/QmRRovo1DE6i5cMjCbf19mQCSuszF6SKwdZNUMS7MtBnH1/go-ipfs-cmds" + cmds "gx/ipfs/QmdTmGruUz23vgzym3uWpnAEQdGdGifQqBvP8UXSRjG8gZ/go-ipfs-cmds" cmdkit "gx/ipfs/Qmde5VP1qUkyQXKCfmEUA7bP64V2HAptbJ7phuPp7jXWwg/go-ipfs-cmdkit" ) diff --git a/core/commands/log.go b/core/commands/log.go index 035c8e96fa94..47c1c7a3aee6 100644 --- a/core/commands/log.go +++ b/core/commands/log.go @@ -4,9 +4,9 @@ import ( "fmt" "io" - cmds "gx/ipfs/QmRRovo1DE6i5cMjCbf19mQCSuszF6SKwdZNUMS7MtBnH1/go-ipfs-cmds" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" lwriter "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log/writer" + cmds "gx/ipfs/QmdTmGruUz23vgzym3uWpnAEQdGdGifQqBvP8UXSRjG8gZ/go-ipfs-cmds" cmdkit "gx/ipfs/Qmde5VP1qUkyQXKCfmEUA7bP64V2HAptbJ7phuPp7jXWwg/go-ipfs-cmdkit" ) diff --git a/core/commands/mount_nofuse.go b/core/commands/mount_nofuse.go index 8b21729c7e03..db31b91d78f7 100644 --- a/core/commands/mount_nofuse.go +++ b/core/commands/mount_nofuse.go @@ -3,7 +3,7 @@ package commands import ( - cmds "gx/ipfs/QmRRovo1DE6i5cMjCbf19mQCSuszF6SKwdZNUMS7MtBnH1/go-ipfs-cmds" + cmds "gx/ipfs/QmdTmGruUz23vgzym3uWpnAEQdGdGifQqBvP8UXSRjG8gZ/go-ipfs-cmds" cmdkit "gx/ipfs/Qmde5VP1qUkyQXKCfmEUA7bP64V2HAptbJ7phuPp7jXWwg/go-ipfs-cmdkit" ) diff --git a/core/commands/mount_unix.go b/core/commands/mount_unix.go index 90622958bae2..ef19861dfe38 100644 --- a/core/commands/mount_unix.go +++ b/core/commands/mount_unix.go @@ -10,7 +10,7 @@ import ( nodeMount "github.com/ipfs/go-ipfs/fuse/node" config "gx/ipfs/QmPEpj17FDRpc7K1aArKZp3RsHtzRMKykeK9GVgn4WQGPR/go-ipfs-config" - cmds "gx/ipfs/QmRRovo1DE6i5cMjCbf19mQCSuszF6SKwdZNUMS7MtBnH1/go-ipfs-cmds" + cmds "gx/ipfs/QmdTmGruUz23vgzym3uWpnAEQdGdGifQqBvP8UXSRjG8gZ/go-ipfs-cmds" cmdkit "gx/ipfs/Qmde5VP1qUkyQXKCfmEUA7bP64V2HAptbJ7phuPp7jXWwg/go-ipfs-cmdkit" ) diff --git a/core/commands/mount_windows.go b/core/commands/mount_windows.go index 1840dea1c4f3..3f99e86e1306 100644 --- a/core/commands/mount_windows.go +++ b/core/commands/mount_windows.go @@ -3,7 +3,7 @@ package commands import ( "errors" - cmds "gx/ipfs/QmRRovo1DE6i5cMjCbf19mQCSuszF6SKwdZNUMS7MtBnH1/go-ipfs-cmds" + cmds "gx/ipfs/QmdTmGruUz23vgzym3uWpnAEQdGdGifQqBvP8UXSRjG8gZ/go-ipfs-cmds" cmdkit "gx/ipfs/Qmde5VP1qUkyQXKCfmEUA7bP64V2HAptbJ7phuPp7jXWwg/go-ipfs-cmdkit" ) @@ -13,7 +13,7 @@ var MountCmd = &cmds.Command{ ShortDescription: "Not yet implemented on Windows. :(", }, - Run: func(req cmds.Request, res cmds.Response) { - res.SetError(errors.New("Mount isn't compatible with Windows yet"), cmdkit.ErrNormal) + Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { + return errors.New("Mount isn't compatible with Windows yet") }, } diff --git a/core/commands/root.go b/core/commands/root.go index 93b8ce10f4ab..d7ff583594f1 100644 --- a/core/commands/root.go +++ b/core/commands/root.go @@ -15,7 +15,7 @@ import ( logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" cmds "gx/ipfs/QmdTmGruUz23vgzym3uWpnAEQdGdGifQqBvP8UXSRjG8gZ/go-ipfs-cmds" - "gx/ipfs/Qmde5VP1qUkyQXKCfmEUA7bP64V2HAptbJ7phuPp7jXWwg/go-ipfs-cmdkit" + cmdkit "gx/ipfs/Qmde5VP1qUkyQXKCfmEUA7bP64V2HAptbJ7phuPp7jXWwg/go-ipfs-cmdkit" ) var log = logging.Logger("core/commands") diff --git a/core/commands/sysdiag.go b/core/commands/sysdiag.go index 673caa61c65e..026cd1ed6e04 100644 --- a/core/commands/sysdiag.go +++ b/core/commands/sysdiag.go @@ -8,9 +8,9 @@ import ( version "github.com/ipfs/go-ipfs" cmdenv "github.com/ipfs/go-ipfs/core/commands/cmdenv" - cmds "gx/ipfs/QmRRovo1DE6i5cMjCbf19mQCSuszF6SKwdZNUMS7MtBnH1/go-ipfs-cmds" sysi "gx/ipfs/QmZRjKbHa6DenStpQJFiaPcEwkZqrx7TH6xTf342LDU3qM/go-sysinfo" manet "gx/ipfs/Qmaabb1tJZ2CX5cp6MuuiGgns71NYoxdgQP6Xdid1dVceC/go-multiaddr-net" + cmds "gx/ipfs/QmdTmGruUz23vgzym3uWpnAEQdGdGifQqBvP8UXSRjG8gZ/go-ipfs-cmds" "gx/ipfs/Qmde5VP1qUkyQXKCfmEUA7bP64V2HAptbJ7phuPp7jXWwg/go-ipfs-cmdkit" )