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:
parent
1325e5c19e
commit
dcceaa4b35
@ -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);
|
||||
|
2
pkg/interp/testdata/repl.fqtest
vendored
2
pkg/interp/testdata/repl.fqtest
vendored
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user