carlos-montiers / enhancedbatch

Enhances your windows command prompt https://www.enhancedbatch.com
Other
5 stars 1 forks source link

Evaluate support options in the begin or at the end in the caller extensions #17

Closed carlos-montiers closed 5 years ago

carlos-montiers commented 5 years ago

Currently, the call extensions only accept options as the first argument.

For example this works: call @say /N Hello

but this not works: call @say Hello /N

Thus, my question is: the caller extensions will only accept options as the first argument ? Or the option parameter can support be indicated in any place ?

This is not only a question about the SAY extension, is for define the way of this for the future caller extensions.

adoxa commented 5 years ago

It might be possible for other extensions to have options after non-options, but not for @say, as it combines all its remaining arguments to make the message (and no, I won't be changing that).

carlos-montiers commented 5 years ago

I not understand why combine all the remaining arguments, it uses malloc. Why not ever use as text the last argument ? Also I have doubts about the number of times malloc is called, maybe we can have memory leaks, because a new call to say will overwrite the text allocated pointer.

adoxa commented 5 years ago

call @say one two is two arguments combined into a single one two string. malloc is called once, as a new call to say will wait for a previous call to finish before doing anything (that's what WaitForSingleObject does).