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

Juan Vuletich juan at cuis.st
Thu Jan 12 06:59:11 PST 2023


Hi Gerald,

I agree that "do not ignore exceptions" doesn't need an argument. Then, 
maybe -e should never take an argument. I also like  -h and -v. Not sure 
about the value of -q, but I wouldn't mind including it.

But can you explain -- and #copyStartupScriptArgumentsFrom: ? Can you 
give an example of use? I don't get it.

Thanks,

On 1/11/2023 6:53 PM, Gerald Klix via Cuis-dev wrote:
> Hi guys,
>
> thanks a lot for the encouraging feedback.
>
> It motivated me to to improve the exception
> ignoring stuff a bit; I just wanted '-e' to work without an argument.
> Then I noticed, that we can't handle options without arguments.
> Therefore I added, em well, some other options to the command line
> parsing code. I hope I haven't overdone it.
>
> You can now say `squeak Cuis.image -h` and get this output:
>
> --- snip --
> Command line options:
> -h Display this help message and quit
> -v Display the system information, containg the version and quit
> -q Just quit
> -e <exception> Evaluate exception and ignore it
> -e Set the exception to ignore to nil, i.e. do not ignore exceptions
> -r <feature> Require <feature>
> -d <code> Evaluate <code>
> -l <codeFile> Load e.g. file in <codeFile>
> -s <scriptFile> Evaluate code ein <scriptFile>
> -c Clear the array of start up script arguments
> -- end of options; stop processing options
>
> Arguments for scripts, code files, packages (and <code>):
> -s and -- store the remaining arguments in 'Smalltalk 
> startUpScriptArguments'
> -c clears the aforementioned array
> Packages (-f), code files (-l) and code (-d) gets a fresh copy of the 
> array if -- is present
>
> Multiple options:
> Options -e, -r, -d, -l, -s and -c can be passed multiple times
> --- snap ---
>
> Please review the change set and give me feedback.
> There might be some incompatibilities.
>
>
> HTH and Best Regards,
>
> Gerald
>
>
>
> On 1/11/23 2:33 PM, Dr. Nicola Mingotti wrote:
>> nice !
>>
>> Nicola
>>
>>
>>
>>
>>
>>
>>
>> On 1/8/23 17:21, Gerald Klix via Cuis-dev wrote:
>>> 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
>>>
>>
>


-- 
Juan Vuletich
cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
linkedin.com/in/juan-vuletich-75611b3
twitter.com/JuanVuletich



More information about the Cuis-dev mailing list