cli: Fix relative path in 'rm' command

Reported-by: Shlomi Livne <shlomi@cloudius-systems.com>
Signed-off-by: Or Cohen <orc@fewbytes.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
cli: Fix error output

Reported-by: Shlomi Livne <shlomi@cloudius-systems.com>
Signed-off-by: Or Cohen <orc@fewbytes.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
cli: Fix df error message when mount not found

Reported-by: Shlomi Livne <shlomi@cloudius-systems.com>
Signed-off-by: Or Cohen <orc@fewbytes.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
cli: Fix -h causing shell to terminate

-h and --help are registered for special handlers in std.optparse. The
behavior is so that it prints the help text and calls exit(). This is unwanted
since it causes the entire shell to exit.

The only way to override this behavior is registering our own handler for
--help and -h. By default, this CLI only overrides "--help" because some
commands would actually use "-h" as an option for something else.

This needs to be solved more thoroughly and the option parser should behave
nicely without workarounds for the simple things. A replacement is being
considered, but this is a fix for now to not confuse users.

Reported-by: Shlomi Livne <shlomi@cloudius-systems.com>
Signed-off-by: Or Cohen <orc@fewbytes.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
cli: Fix 'api' working with remaning args

'api' command positivley matched API paths even if there were more, unrelated,
arguments in the comand line.

Reported-by: Shlomi Livne <shlomi@cloudius-systems.com>
Signed-off-by: Or Cohen <orc@fewbytes.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
cli: Add help where missing in commands

Reported-by: Shlomi Livne <shlomi@cloudius-systems.com>
Signed-off-by: Or Cohen <orc@fewbytes.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
cli: Add cooperative interrupt for ^C

Add a new function to the CLI, cli_interrupted(), which is meant for "infinite"
commands like top. SIGINT sets cli_interrupted variable to 1, which is then
being queried from Lua with "cli_interrupted()".

Since the signal handler is running in a different thread, setting a value
directly in Lua might interfere with the thread currently running the code, so
this value is set on the embedding part.

Signed-off-by: Or Cohen <orc@fewbytes.com>
Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
cli: Use cli_interrupt() in top

Signed-off-by: Or Cohen <orc@fewbytes.com>
Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
cli: Enable non-200 replies in osv_mock_request

Signed-off-by: Or Cohen <orc@fewbytes.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
cli: Add tests for non-200 API responses

Signed-off-by: Or Cohen <orc@fewbytes.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
gitignore for httpserver and tests modules

Signed-off-by: Or Cohen <orc@fewbytes.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>