Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'data' to help screen #151

Closed
timothyhinrichs opened this issue Nov 16, 2016 · 2 comments
Closed

Add 'data' to help screen #151

timothyhinrichs opened this issue Nov 16, 2016 · 2 comments

Comments

@timothyhinrichs
Copy link
Member

timothyhinrichs commented Nov 16, 2016

It'd be great if we included 'data' as a command in the help screen in the repl so that people can see all their data. Couple of use cases.

  1. show all data currently available. data
  2. show top-level keys in the data currently available (for when there's too much data). data[x] = _
  3. drill into data. data.foo.bar

Would be nice if all of those were available from help (maybe with subhelp commands like 'help data').

@tsandall
Copy link
Member

tsandall commented Nov 16, 2016

Tempted to add an "Examples" section to the 'help' message. For example:

$ opa run *.json
OPA 0.2.1-dev (commit f56ae0d, built at 2016-11-14T22:38:16Z)

Run 'help' to see examples and list of commands.

> help

Examples
========

> data           # show all data and evaluate all rules
> data[x] = _    # show top-level keys
> data.foo.bar   # show specific value

Commands
========

        <stmt> : evaluate the statement
package <term> : change currently active package
 import <term> : add import to currently active module
   unset <var> : undefine rules in currently active module
          json : set output format to JSON
        pretty : set output format to pretty
   dump [path] : dump the raw storage content
         trace : toggle full trace
         truth : toggle truth explanation
          help : print this message
          exit : exit back to shell (or ctrl+c, ctrl+d)
        ctrl+l : clear the screen

@timothyhinrichs
Copy link
Member Author

I like that, though people might want examples for things besides lookup. And then the examples section might large. But perhaps that's a bridge we'll cross when we get to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants