From 187164fc7d85a157f209a8353918e5acf4da7f71 Mon Sep 17 00:00:00 2001 From: Jan Philipp Timme Date: Tue, 1 Jan 2019 21:16:06 +0100 Subject: [PATCH] Provide a better help for the shell --- shell.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/shell.go b/shell.go index 52b9f92..20f5f79 100644 --- a/shell.go +++ b/shell.go @@ -64,7 +64,7 @@ func displayMessageDetails(fields []string, writer io.Writer, state shellState) func interactiveShell(reader io.Reader, writer io.Writer) { var state shellState = initialShellState() - fmt.Fprintln(writer, "Let's try an interactive shell!") + printHelp(writer) scanner := bufio.NewScanner(reader) for { fmt.Fprint(writer, "> ") @@ -104,11 +104,15 @@ func interactiveShell(reader io.Reader, writer io.Writer) { break } } - fmt.Fprintln(writer, "\nGoodbye!\n") } func printHelp(writer io.Writer) { fmt.Fprintln(writer, "Available commands:") - fmt.Fprintln(writer, "?, help: display this output") - fmt.Fprintln(writer, "exit: quit this program") + fmt.Fprintln(writer, "help\tdisplay this output") + fmt.Fprintln(writer, "exit\tquit this program") + fmt.Fprintln(writer, "reload\treload mailq") + fmt.Fprintln(writer, "sort\tdefine how to sort mailq before showing") + fmt.Fprintln(writer, "show\tshow mailq") + fmt.Fprintln(writer, "summary\tshow mailq summary") + fmt.Fprintln(writer, "") }