mirror of
https://github.com/wader/fq.git
synced 2024-12-29 00:22:38 +03:00
repl: Give error if repl is used in non-repl mode
This commit is contained in:
parent
ec98fd315a
commit
44d8b66a8e
@ -331,8 +331,11 @@ def _repl_iter($opts): _repl($opts);
|
|||||||
def _repl_iter: _repl({});
|
def _repl_iter: _repl({});
|
||||||
|
|
||||||
# just gives error, call appearing last will be renamed to _repl_iter
|
# just gives error, call appearing last will be renamed to _repl_iter
|
||||||
def repl($_): error("repl must be last");
|
def repl($_):
|
||||||
def repl: error("repl must be last");
|
if options.repl then error("repl must be last")
|
||||||
|
else error("repl can't be used in non-repl mode")
|
||||||
|
end;
|
||||||
|
def repl: repl(null);
|
||||||
|
|
||||||
|
|
||||||
def _cli_expr_on_error:
|
def _cli_expr_on_error:
|
||||||
|
4
pkg/interp/testdata/repl.fqtest
vendored
4
pkg/interp/testdata/repl.fqtest
vendored
@ -58,3 +58,7 @@ $ fq -i '[1,2,3]'
|
|||||||
[1,2,3]
|
[1,2,3]
|
||||||
> [number, ...][3]> ^D
|
> [number, ...][3]> ^D
|
||||||
[number, ...][3]> ^D
|
[number, ...][3]> ^D
|
||||||
|
$ fq -n repl
|
||||||
|
exitcode: 5
|
||||||
|
stderr:
|
||||||
|
error: repl can't be used in non-repl mode
|
||||||
|
Loading…
Reference in New Issue
Block a user