> On 17 May 2017, at 14:24, K K Subbu <[email protected]> wrote: > > On Wednesday 17 May 2017 05:12 PM, Max Leske wrote: >> Yes. #exitSuccess does a bit more: >> 1. return an exit code to the command line >> 2. print a message >> 3. check if the session has changed >> 4. allows for overriding and special handling of the Exit exception. >> >> You should not assume that nobody needs that :) > > Thanks for the quick clarification. I am trying to understand the difference > between using quit and save/quit. exitSuccess never gets called when both > options "--save --quit" are given. Shouldn't the code handle this case as > well: > > (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. What will happen after the next startup is that the execution will arrive at the *same point*. It will check 'quit' and exit as before, you will not be able to get back in to the image. You should definitely try playing around with that, just be sure to make a copy of your image first :) Cheers, Max > > Regards .. Subbu >
