diff --git a/src/contexts/cli/cli.go b/src/contexts/cli/cli.go index e3e0f1bd..03153a54 100644 --- a/src/contexts/cli/cli.go +++ b/src/contexts/cli/cli.go @@ -732,7 +732,7 @@ func main() { ioutil.WriteFile(path.Join(p, kit.Format(value["name"])), []byte(kit.Format(value["text"])), 0666) }) } - m.Cmdy("nfs.dir", p, "time", "size", "line", "path") + m.Cmdy("nfs.dir", p, "time", "line", "hashs", "path") } return }}, @@ -790,8 +790,8 @@ func main() { if m.Cmdy("cli.system", env, "go", "build", o, "-o", q, p); m.Result(0) == "" { m.Append("time", m.Time()) + m.Append("hash", kit.Hashs(q)[:8]) m.Append("bin", q) - m.Append("hash", kit.Hashs(q)) m.Table() } } @@ -819,7 +819,7 @@ func main() { for _, v := range arg[1:] { m.Cmd("nfs.copy", path.Join(q, v), path.Join(p, v)) } - m.Cmdy("nfs.dir", q, "time", "size", "hash", "path") + m.Cmdy("nfs.dir", q, "time", "size", "hashs", "path") return e } diff --git a/src/contexts/cli/version.go b/src/contexts/cli/version.go index 34545580..601ebc16 100644 --- a/src/contexts/cli/version.go +++ b/src/contexts/cli/version.go @@ -4,5 +4,5 @@ var version = struct { host string self int }{ - "2019-07-15 20:46:47", "ZYB-20190522USI.ubuntu", 168, + "2019-07-16 10:26:05", "ZYB-20190522USI.ubuntu", 176, } diff --git a/src/contexts/ctx/core.go b/src/contexts/ctx/core.go index 48b7e1a2..b6f18168 100644 --- a/src/contexts/ctx/core.go +++ b/src/contexts/ctx/core.go @@ -34,6 +34,7 @@ func (c *Context) Register(s *Context, x Server, args ...interface{}) *Context { func (c *Context) Plugin(s *Context, args []string) string { c.Register(s, nil) m := &Message{code: 0, time: time.Now(), source: s, target: s, Meta: map[string][]string{}} + kit.DisableLog = true m.Option("log.disable", true) m.Option("cli.modal", "action") @@ -56,7 +57,10 @@ func (c *Context) Plugin(s *Context, args []string) string { } m.Cmd(args) } - return strings.Join(m.Meta["result"], "") + for _, v := range m.Meta["result"] { + m.Show(v) + } + return "" } func (c *Context) Spawn(m *Message, name string, help string) *Context { s := &Context{Name: name, Help: help, root: c.root, context: c, message: m, diff --git a/src/contexts/nfs/nfs.go b/src/contexts/nfs/nfs.go index 9d978904..18550735 100644 --- a/src/contexts/nfs/nfs.go +++ b/src/contexts/nfs/nfs.go @@ -114,7 +114,7 @@ func dir(m *ctx.Message, name string, level int, deep bool, dir_type string, tri } } m.Add("append", "line", nline) - case "hash": + case "hash", "hashs": if f.IsDir() { d, e := ioutil.ReadDir(path.Join(name, f.Name())) m.Assert(e) @@ -132,7 +132,12 @@ func dir(m *ctx.Message, name string, level int, deep bool, dir_type string, tri f, e := ioutil.ReadFile(path.Join(name, f.Name())) m.Assert(e) h := sha1.Sum(f) - m.Add("append", "hash", hex.EncodeToString(h[:])) + + if field == "hash" { + m.Add("append", "hash", hex.EncodeToString(h[:])) + } else { + m.Add("append", "hash", hex.EncodeToString(h[:4])) + } } } }