Skip to content

Commit

Permalink
use history
Browse files Browse the repository at this point in the history
  • Loading branch information
c4pt0r committed Sep 15, 2022
1 parent 677317e commit 6bf1a10
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ func main() {
handler := cmd.Handler()
//completer := cmd.Completer()
longhelp := cmd.LongHelp()
shell.SetHomeHistoryPath(".tcli.history")
shell.AddCmd(&ishell.Cmd{
Name: cmd.Name(),
Help: cmd.Help(),
Expand Down
4 changes: 2 additions & 2 deletions utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ func OutputWithElapse(f func() error) error {
tt := time.Now()
err := f()
if err != nil {
fmt.Fprintf(os.Stderr, "\033[31mError: %s\033[0m, Elapse: %d ms\n", err, time.Since(tt)/time.Millisecond)
fmt.Fprintf(os.Stderr, "\033[31mError: %s\033[0m\nElapse: %d ms\n", err, time.Since(tt)/time.Millisecond)
} else {
fmt.Fprintf(os.Stderr, "\033[32mSuccess\033[0m, Elapse: %d ms\n", time.Since(tt)/time.Millisecond)
fmt.Fprintf(os.Stderr, "\033[32mSuccess\033[0m\nElapse: %d ms\n", time.Since(tt)/time.Millisecond)
}
return err
}
Expand Down

0 comments on commit 6bf1a10

Please sign in to comment.