From a47ddbaa56bddb7c58ec79f9664b9ff928f7d2b1 Mon Sep 17 00:00:00 2001 From: Torin Sandall Date: Tue, 21 Jun 2016 18:19:32 -0700 Subject: [PATCH] Print help message on startup --- repl/repl.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/repl/repl.go b/repl/repl.go index c83171b41c..2b92e9a9ff 100644 --- a/repl/repl.go +++ b/repl/repl.go @@ -16,6 +16,8 @@ import ( "github.com/open-policy-agent/opa/ast" "github.com/open-policy-agent/opa/storage" "github.com/open-policy-agent/opa/topdown" + "github.com/open-policy-agent/opa/version" + "github.com/peterh/liner" ) @@ -64,6 +66,11 @@ func (r *REPL) Loop() { line.SetMultiLineMode(true) r.loadHistory(line) + fmt.Fprintf(r.output, "OPA %v (commit %v, built at %v)\n", version.Version, version.Vcs, version.Timestamp) + fmt.Fprintf(r.output, "\n") + fmt.Fprintf(r.output, "Run 'help' to see a list of commands.\n") + fmt.Fprintf(r.output, "\n") + for true { input, err := line.Prompt(r.getPrompt()) @@ -148,6 +155,8 @@ func (r *REPL) cmdHelp() bool { note string }{ {"", "evaluate the statement"}, + {"package ", "change currently active package"}, + {"import ", "add import to currently active module"}, {"json", "set output format to JSON"}, {"pretty", "set output format to pretty"}, {"dump", "dump the raw storage content"},