1
1
mirror of https://github.com/wader/fq.git synced 2024-09-20 08:18:51 +03:00

repl: Fix help and error message a bit

This commit is contained in:
Mattias Wadman 2021-09-12 13:04:51 +02:00
parent 1325e5c19e
commit dcceaa4b35
2 changed files with 7 additions and 6 deletions

View File

@ -377,7 +377,7 @@ def _repl_iter: _repl({});
# just gives error, call appearing last will be renamed to _repl_iter
def repl($_):
if options.repl then error("repl must be last")
else error("repl can't be used in non-repl mode")
else error("repl can only be be used from repl")
end;
def repl: repl(null);
@ -401,10 +401,11 @@ def _cli_expr_eval($expr; $filename):
# TODO: introspect and show doc, reflection somehow?
def help:
( "Type jq expression to evaluate"
, "\\t Auto completion"
, "Up/Down History"
, "^C Interrupt execution"
, "^D Exit REPL"
, "\\t Auto completion"
, "Up/Down History"
, "^C Interrupt execution"
, "... | repl Start a new REPL"
, "^D Exit REPL"
) | println;
def display($opts): _display($opts);

View File

@ -61,4 +61,4 @@ $ fq -i '[1,2,3]'
$ fq -n repl
exitcode: 5
stderr:
error: repl can't be used in non-repl mode
error: repl can only be be used from repl