Skip to content

Commit 6bf1a10

Browse files
committed
use history
1 parent 677317e commit 6bf1a10

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

cli/main.go

+1
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ func main() {
130130
handler := cmd.Handler()
131131
//completer := cmd.Completer()
132132
longhelp := cmd.LongHelp()
133+
shell.SetHomeHistoryPath(".tcli.history")
133134
shell.AddCmd(&ishell.Cmd{
134135
Name: cmd.Name(),
135136
Help: cmd.Help(),

utils/utils.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ func OutputWithElapse(f func() error) error {
3535
tt := time.Now()
3636
err := f()
3737
if err != nil {
38-
fmt.Fprintf(os.Stderr, "\033[31mError: %s\033[0m, Elapse: %d ms\n", err, time.Since(tt)/time.Millisecond)
38+
fmt.Fprintf(os.Stderr, "\033[31mError: %s\033[0m\nElapse: %d ms\n", err, time.Since(tt)/time.Millisecond)
3939
} else {
40-
fmt.Fprintf(os.Stderr, "\033[32mSuccess\033[0m, Elapse: %d ms\n", time.Since(tt)/time.Millisecond)
40+
fmt.Fprintf(os.Stderr, "\033[32mSuccess\033[0m\nElapse: %d ms\n", time.Since(tt)/time.Millisecond)
4141
}
4242
return err
4343
}

0 commit comments

Comments
 (0)