diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-05-30 23:04:31 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-05-30 23:04:31 -0700 |
commit | c91af9a17b0533c6df846ff712e7ade306c7b38a (patch) | |
tree | db34c427af795aff50f1a2227b88cfa6698af196 /txr.c | |
parent | 8cd3b90ca5b3b3cf8d2796da6b9374784c0f10cf (diff) | |
download | txr-c91af9a17b0533c6df846ff712e7ade306c7b38a.tar.gz txr-c91af9a17b0533c6df846ff712e7ade306c7b38a.tar.bz2 txr-c91af9a17b0533c6df846ff712e7ade306c7b38a.zip |
command line: --eargs semantics change.
The --eargs mechanism won't perform a blind substring
replacement of {} with the following argument. Only
arguments which match {} exactly are replaced.
* eval.c (retf): Static function becomes extern.
* eval.h (retf): Declared.
* txr.c (txr_main): Replace the filtering logic on the
split eargs argument list to just look for items
equal to the string "{}" and replace with the following
argument.
* txr.1: Updated --eargs documentation.
Diffstat (limited to 'txr.c')
-rw-r--r-- | txr.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -573,9 +573,8 @@ int txr_main(int argc, char **argv) } arg = sub_str(arg, num(8), nil); arg2 = upop(&arg_list, &arg_undo); - arg_list = append2(mapcar(curry_123_3(func_n3(regsub), - regex_compile(lit("{}"), nil), - arg2), + arg_list = append2(mapcar(iffi(curry_12_2(equal_f, lit("{}")), + retf(arg2), nil), split_str(arg, sep)), arg_list); set(eff_arg_tail, butlastn(one, deref(eff_arg_tail))); |