mirror of
https://github.com/wader/fq.git
synced 2024-12-27 15:42:07 +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({});
|
||||
|
||||
# just gives error, call appearing last will be renamed to _repl_iter
|
||||
def repl($_): error("repl must be last");
|
||||
def repl: error("repl must be last");
|
||||
def repl($_):
|
||||
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:
|
||||
|
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]
|
||||
> [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