1
0
forked from x/ContextOS

tce mod nfs.history

This commit is contained in:
shaoying 2018-08-20 21:54:14 +08:00
parent 14e4c3818c
commit 76cd7bf6c0
3 changed files with 18 additions and 3 deletions

View File

@ -8,6 +8,11 @@ install:
@cp etc/go.snippets ~/.vim/snippets/
@cp etc/shy.vim ~/.vim/syntax/
@touch etc/local.shy
@touch etc/local_exit.shy
@touch etc/init.shy
@touch etc/exit.shy
@touch etc/login.txt
@touch etc/history.txt
go install $(BENCH)
# @[ `uname` = "Darwin" ] && md5 `which bench`
@date

View File

@ -10,3 +10,4 @@ source etc/local.shy
alias import nfs
alias send send
alias dial dial

View File

@ -856,9 +856,9 @@ var Index = &ctx.Context{Name: "nfs", Help: "存储中心",
"git_log": &ctx.Config{Name: "git_log", Value: "--pretty=%h %an(%ad) %s --date=format:%m/%d %H:%M --graph", Help: "版本控制状态参数"},
"git_log_form": &ctx.Config{Name: "git_log", Value: "stat", Help: "版本控制状态参数"},
"git_log_skip": &ctx.Config{Name: "git_log", Value: "0", Help: "版本控制状态参数"},
"git_log_line": &ctx.Config{Name: "git_log", Value: "5", Help: "版本控制状态参数"},
"git_log_line": &ctx.Config{Name: "git_log", Value: "3", Help: "版本控制状态参数"},
"git_path": &ctx.Config{Name: "git_path", Value: ".", Help: "版本控制默认路径"},
"git_info": &ctx.Config{Name: "git_info", Value: "branch status diff", Help: "命令集合"},
"git_info": &ctx.Config{Name: "git_info", Value: "branch status diff log", Help: "命令集合"},
},
Commands: map[string]*ctx.Command{
"paths": &ctx.Command{
@ -949,11 +949,20 @@ var Index = &ctx.Context{Name: "nfs", Help: "存储中心",
if lines != -1 && (i-pos) >= lines {
break
}
nfs.history = append(nfs.history, bio.Text())
line := bio.Text()
for _, v := range nfs.history {
if line == v {
line = ""
}
}
if line != "" {
nfs.history = append(nfs.history, line)
}
}
m.Capi("nline", 0, len(nfs.history))
case "save":
f, e := os.Create(arg[1])
// f, e := os.OpenFile(arg[1], os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0666)
m.Assert(e)
defer f.Close()