On 6/5/08, Isaac Dupree <[EMAIL PROTECTED]> wrote:
> Philip Ganchev wrote:
>> I guess what's confusing is the talk about token types, which is are
>> apparently something specific to Fish and not explained in the manual.
>>  Why doesn't the message just say
>>
>> fish: Expected redirection specification, got "\n" (newline)
>> echo > (echo)
>>        ^
>> or
>>
>> fish: Invalid file name ""  for output redirection
>> echo > (echo -n)
>>        ^
>>
>> I think the error message repeats the problematic token so that the
>> user can see it. If it said 'Can't redirect to ""', the user would
>> wonder which part of the command she typed produced the "".  But the
>> message needs to say that the token expands to "" or to newline, which
>> are invalid file names.  And it does not need to mention tokens.
>>
>> What do you suggest the messages should be?
>
> in that case I'd rather mention "" (expanded from (echo -n))
> or anyway mention both the value and the expression, for best
> understanding, somehow.
>
> BTW. newline is technically a valid filename (at least on my
> filesystem/OS, a normal linux) -- you just don't want it to be!
>
> Anyway, it shouldn't be tokenized, basically: it's a single entity, just
> like a function argument is.  And even if the variable expands to '&1',
> it writes to the file named '&1'.
>
> how about
>
> fish: Invalid file name "" from (echo -n) for output redirection
>
> Actually, fish more typically repeats the whole expression and points at
> the troublesome part with a ^, instead of naming the subexpression
> inline in the error. (although I'd prefer it to also color the text
> range it's mentioning, which would be easier for the eye to pick out and
> notice, generally)
>
>>
>> On 6/5/08, Isaac Dupree <[EMAIL PROTECTED]> wrote:
>>>  > set filename abcde
>>>  > set --erase not_a_filename
>>>
>>>  > echo out > $filename
>>>  > rm $filename
>>>  > #given that, this is weird:
>>>  > echo out > $not_a_filename
>>> fish: Expected redirection specification, got token of type
>>> "$not_a_filename"
>>> echo out > $not_a_filename
>>>             ^
>>>
>>>  > echo out > (echo $filename)
>>>  > rm $filename
>>>  > echo out > (echo $not_a_filename)
>>> fish: Invalid IO redirection
>>> echo out > (echo $not_a_filename)
>>>             ^
>>>  > echo out > (echo)
>>> fish: Invalid IO redirection
>>> echo out > (echo)
>>>             ^
>>>  > echo out > (echo -n)
>>> fish: Expected redirection specification, got token of type "(echo -n)"
>>> echo out > (echo -n)
>>>             ^
>>>
>>> Hmm. I'm a little confused (although luckily it seems to be only the
>>> messages that are confusing me -- it seems quite sensible so far in
>>> *whether* it accepts a redirection)
>>>
>>> -Isaac
>>>
>>> -------------------------------------------------------------------------
>>> Check out the new SourceForge.net Marketplace.
>>> It's the best place to buy or sell services for
>>> just about anything Open Source.
>>> http://sourceforge.net/services/buy/index.php
>>> _______________________________________________
>>> Fish-users mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/fish-users
>>>
>>
>
>

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Fish-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to