On 17 May 2017, at 15:23, Damien Pollet <damien.pollet@gmail.com> wrote:
On 17 May 2017 at 14:34, Max Leske <maxleske@gmail.com <mailto:maxleske@gmail.com>> wrote:
(self hasOption: 'save') ifTrue: [ Smalltalk snapshot: true andQuit: false ]. (self hasOption: 'quit') ifTrue: [ self exitSuccess ].
Yes, I think so. But you have to be careful there. Imagine that you first save with "Smalltalk snapshot: true andQuit: false" and then you check for 'quit' and send #exitSuccess.
But in this version the lookup for option quit is done again when the images wakes up. Compare to the version originally copied by Subbu:
| quit | quit := self commandLine hasOption: 'quit'. (self commandLine hasOption: 'save') ifTrue: [ Smalltalk snapshot: true andQuit: quit ]. quit ifTrue: [ self exitSuccess ].
Here I'm guessing if you --save --quit then the image will get saved, and next time it wakes up, enters the second conditional and #exitSuccess⦠confusing :/
Very. When I look at this code, without going into the image and look, I would say that it will lead to exactly what I described: the image will start and exit again immediately.
-- Damien Pollet type less, do more [ | ] http://people.untyped.org/damien.pollet <http://people.untyped.org/damien.pollet>