Re: Documentation feedback: surprising behavior of null substitutes

2016-05-20 Thread Max Ivanov
To me new docs make it much clearer now what effect "no word" can
have, but once you learned something it is hard to say whether it
fully explains the behavior and warns about pitfall well enough so
that next newcomer will not have a problem with it.

On 20 May 2016 at 17:18, Laurent Bercot  wrote:
> On 20/05/2016 18:09, Max Ivanov wrote:
>>
>> so it uses "zero word" and "null word" interchangeably, which doesn't
>> help either :) "zero word" seems closer to "empty word" (==no
>> magic,just ''), than to "null word" (magic)
>
>
>  Changed the importas.html file. Is the current wording (no pun intended)
> clear enough?
>
> --
>  Laurent


Re: Documentation feedback: surprising behavior of null substitutes

2016-05-20 Thread Laurent Bercot

On 20/05/2016 17:42, Max Ivanov wrote:

Docs on 'importas' specify that missing env var without a default
value would produce a "null arg", however nowhere else term "null arg"
is used or described (including very important "el_substitute"
document), which lead to a surprising result at least for me:

```
emptyenv -p import -u VAR s6-echo ABC:${VAR}:XYZ 123
```

prints just "123", instead of expected "ABC::XYZ 123"


 Documentation for the -D option to importas: "If envvar is undefined,
and this option is not given, substitute zero word for variable instead
of the empty word".

 But you're right, despite it being a natural consequence of the
substitution rules, it's not intuitive that a word that contains ${VAR}
is completely removed when VAR is undefined. I will add a note to the
importas documentation that clarifies this.

--
 Laurent