On 17 May 2017 at 14:34, Max Leske <[email protected]> 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 :/
--
Damien Pollet
type less, do more [ | ] http://people.untyped.org/damien.pollet