On Thu, Feb 18, 2016 at 5:21 PM, Bram Moolenaar <[email protected]> wrote:
>
> Gary Johnson wrote:
>
>> On 2016-02-18, Bram Moolenaar wrote:
>> > Yasuhiro Matsumoto wrote:
>> >
>> > > $ vim -u NONE -i NONE -N -e -c NonExistCommand -c qall
>> > > $ echo $?
>> > > 1
>> > >
>> > > This command exit with exit code 1. I'm thinking this is reasonable to
>> > > return non-zero value into shell, and quit vim properly. But I'm
>> > > thinking, when the NonExistCommand was executed with "silent!", this
>> > > command should return 0.
>> > >
>> > > $ vim -u NONE -i NONE -N -e -c "silent! NonExistCommand" -c qall
>> >
>> > Good idea.
>> >
>> > I can't find the place in the docs where the exit value is documented...
>>
>> The only place I can find is ":help :cq".
>>
>> FWIW, Steve Losh's Splice plugin relies on :qa exiting with a zero
>> status and :cq exiting with a non-zero status.  I don't think the
>> current proposal breaks that, but as usual, we need to be careful
>> about changing behavior even if it seems to make sense.
>
> I believe it's POSIX compatible that any Ex command error results in a
> non-zero exit code.  Avoiding that with :silent! seems appropriate.
>
> I'll add a short section in starting.txt about exiting.  We can further
> ehance that over time.

Note that v:errmsg is filled even with ":silent!". I guess that could
be useful, and might be worth mentioning in the starting.txt section.

---
Justin M. Keyes

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui