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.
--
FATHER: Make sure the Prince doesn't leave this room until I come and
get him.
FIRST GUARD: Not ... to leave the room ... even if you come and get him.
FATHER: No. Until I come and get him.
SECOND GUARD: Hic.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
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.