Skip to content
Snippets Groups Projects
Unverified Commit fef67c76 authored by Kevin Lyda's avatar Kevin Lyda
Browse files

Fix history file

parent 54e6832b
No related branches found
No related tags found
No related merge requests found
...@@ -3,6 +3,7 @@ package repl ...@@ -3,6 +3,7 @@ package repl
import ( import (
"fmt" "fmt"
"os"
"path" "path"
"unicode" "unicode"
...@@ -13,12 +14,13 @@ import ( ...@@ -13,12 +14,13 @@ import (
// Loop is the main event loop. // Loop is the main event loop.
func Loop() error { func Loop() error {
// fmt.Printf("TODO: get config for user %s using xdg.\n", user) histdir := path.Join(xdg.ConfigHome, "BULLETIN")
os.MkdirAll(histdir, 0700)
histfile := path.Join(histdir, fmt.Sprintf("%s.history", this.User.Login))
rl, err := readline.NewEx( rl, err := readline.NewEx(
&readline.Config{ &readline.Config{
Prompt: "BULLETIN> ", Prompt: "BULLETIN> ",
HistoryFile: path.Join(xdg.ConfigHome, "BULLETIN", HistoryFile: histfile,
fmt.Sprintf("%s.history", this.User.Login)),
// TODO: AutoComplete: completer, // TODO: AutoComplete: completer,
InterruptPrompt: "^C", InterruptPrompt: "^C",
EOFPrompt: "EXIT", EOFPrompt: "EXIT",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment