diff options
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 20 |
1 files changed, 11 insertions, 9 deletions
@@ -44,14 +44,8 @@ func main() { state.Quiet = true } - if urls := flag.Args(); len(urls) > 0 { - if err := Go(state, urls[0]); err != nil { - writeError(err.Error()) - } - } - - // runInteractivePrompt(state) - runTUI(state) + runInteractivePrompt(state, flag.Args()) + // runTUI(state, flag.Args()) } func buildReadline(prompt string, conf *Config) (*readline.Instance, error) { @@ -106,7 +100,15 @@ func buildInitialState() (*BrowserState, error) { return state, nil } -func runInteractivePrompt(state *BrowserState) { +func runInteractivePrompt(state *BrowserState, args []string) { + state.Printer = PromptPrinter{} + + if len(args) > 0 { + if err := Go(state, args[0]); err != nil { + writeError(err.Error()) + } + } + for { state.Readline.SetPrompt(Prompt) line, err := state.Readline.Readline() |
