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.1 | |
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.1')
-rw-r--r-- | txr.1 | 36 |
1 files changed, 26 insertions, 10 deletions
@@ -769,10 +769,10 @@ option (extended .codn --args ) is like .code --args -but must be followed by an argument. The argument is substituted -in place of occurrences of +but must be followed by an argument. The argument is removed from +the argument list and substituted in place of occurrences of .code {} -in the +among the arguments expanded from the .code --eargs syntax. @@ -1136,11 +1136,17 @@ The mechanism allows an additional flexibility. An .code --eargs argument must be followed by one more argument. -Occurrences of the two-character sequence + +After +.code --eargs +performs the argument splitting in the same manner as +.codn --args , +any of the arguments which it produces which are the +two-character sequence .code {} -in the encoded argument string are replaced with that -following argument. This replacement occurs after -the argument splitting. +are replaced with that following argument. Whether +or not the replacement occurs, that following argument +is then removed. Example: @@ -1172,9 +1178,11 @@ processing takes place, firstly the argument sequence -B {} --foo 42 .cble -is produced. Then, all occurrences of +is produced by splitting into four fields using the +.code : +character as the separator. Then, within these four fields, all occurrences of .code {} -are replaced with +are replaced with the following argument .codn script.txr , resulting in: @@ -1182,7 +1190,15 @@ resulting in: -B script.txr --foo 42 .cble -The resulting \*(TX invocation is +Furthermore, that +.code script.txr +argument is removed from the remaining argument list. + +The four arguments are then substituted in place of the original +.code --eargs:-B:{}:--foo:42 +syntax. + +The resulting \*(TX invocation is, therefore: .cblk /usr/bin/txr -B script.txr --foo 42 a b c |