[Cuis-dev] [IMPROV] Configurable command line exception handling

Gerald Klix Gerald.Klix at klix.ch
Thu Jan 12 12:59:24 PST 2023


Hi Hilaire,

please see my answers below.

On 1/12/23 12:16 PM, Hilaire Fernandes via Cuis-dev wrote:
> Thanks Gerald,
You're welcome.
>
> I tested a bit. As expected, it raises the debugger when I start with 
> a faulty script.
>
> A few observations:
>
> 1) One can get the help without the open/close VM window sequence with 
> the VM -headless option:
>
> ../VM/squeak -headless cuis.image -h
Yes of course, but it's not very portable, on Windows you have to use 
SqueakConsole.exe
>
> A bit odd but it may have the side effect for the newbie to understand 
> where are going the different options.
Yes, it took me some time time to discover, that startUpScriptArguments 
is empty if
I load a package with `-f`. I still consider this surprising.
>
> 2) If I understand correctly, after the -- option I can add option I 
> can then process myself in the image? If so I can use it to process 
> option passed to DrGeo, for example to open a sketch file from a file 
> manager, right ?
Yes, that' s it.
>
> 3) Spelling error: -s <scriptFile> Evaluate code *ein* <scriptFile>
Thanks! Fixed.

>
> 4) I will test further the -e option in future evolution of my start 
> up script.
>
> 5) If integrated in the image, I will document it in the Cuis Book.
The next -- simplified -- version will follow suit. Just give me another 
5 minutes.
>
> Hilaire
>
> Le 08/01/2023 à 17:21, Gerald Klix via Cuis-dev a écrit :
>> Hi all, Hi Juan,
>>
>> I was bit annoyed by the impossibility to debug scripts and packages
>> run or installed from the command line.
>> Therefore I added an option, ``-e <argument>``, that lets you
>> set the exception class to handle before executing a script.
>>
>> With the attached change set, you can now write:
>>
>> squeak Cuis.image -e nil -s myScript.st
>>
>> If ``myScript.st`` contains an error, a Debugger
>> will pop up.
>>
>>
>> HTH and Best Regards,
>>
>> Gerald 
>
>
HTH,

Gerald


More information about the Cuis-dev mailing list