Skip to content

cli: Add "shell" subcommand

Carlos Garnacho requested to merge wip/carlosg/sparql-shell into master

From the main commit:

As the command says, this creates a "shell" connecting to a given
SPARQL endpoint (by default, in-memory DB), so that multiple queries
can be executed on it.

This shell is rather basic, allowing to either quit (via Ctrl-Q or
3 Ctrl-C presses), or execute the given SPARQL query (via Ctrl-X).
When displaying a cursor content, output is redirected to a pager
(by default "less") for display purposes, returning back to the
SPARQL shell after quitting. It also has some rudimentary history
support, allowing the use of PgUp and PgDown to navigate through the
prior command list. This list only holds up for the running session
though and is not saved in disk.

The editor handles multiline and text that is larger than the
available screen size, and handles the minimal set of keys that
is expected for navigation.

When dealing with errors, the full error message is displayed, and
the editor cursor is moved to the location of the syntax error
(if any, and available).

There's some possible areas of improvement:
- Handling of unicode
- Allowing updates as well as queries

But these may improve in the future, this feels already functional
and helpful.

Merge request reports