[Cuis-dev] [IMPROV] Configurable command line exception handling
Gerald Klix
cuis.01 at klix.ch
Wed Jan 11 13:53:43 PST 2023
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
>>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 5627-VastlyImprovedCommandLineParsing-GeraldKlix-2023Jan11-20h15m-KLG.001.cs.st
Type: application/vnd.sailingtracker.track
Size: 15810 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230111/4d1fc1dd/attachment.bin>
More information about the Cuis-dev
mailing list