On 2022-11-19 11:50, Lawrence Velázquez wrote:
A "single argument" is not intuitive at all. You would not run tree '-L 2' or tree -L\ 2 so it does not make any sense to think that "tree" wants a single argument there.
Intuition is subjective. Besides, usually such switches don't demand a space IIRC and it really is actually one argument, this is an exception. Even if the space is demanded, one might still think of a switch as a single semantic instruction even if it must be syntactically two words. A filename with a space in it is NOT broken in half, it's still one entity, so I'm thinking the same way. I myself was naively thinking of it as nothing more than a string of four characters to be dropped into another string of characters -- as simple as that. As if it was the command line. But commands do have their need to group characters into arguments so the invisible rules must be followed. ' -L 2 ' must be invisibly broken in half. Which, interestingly 'eval' seems to do automatically. It's a huge thing coming to understand that what to me might look like 'just' a string of characters, to a command, needs to be viewed differently. Once I understand that, things get much simpler. I guess internally zsh must have all sorts of meta data attached to arrays to keep track of what's joined/split to/from what else. It would be cool to be able to somehow see this invisible stuff, some way to see the invisible structure of a command line. But I'll be ready the next time something like this crops up.