I've played a lot with the new command line argument handling. Here's a few
thoughts:
* I think we should not allow the use of raw handler names (e.g. 'eval') and
restrict ourselves to flags. For example, disallow 'eval' and stick to '-e'
or '--evaluate'. The raw name introduces ambiguity in parsing the command
line, especially since custom commands can be added at will that may
conflict and see next item...
* The current implementation chooses the single matching handler with the
highest priority, but usually command line tools may have multiple
non-conflicting flags
* The priority concept seems premature. It adds complexity and confusion
(the handler for a specific flag is not obvious because it emerges from an
interaction of all the handlers). Maybe a registry would be better? A
dictionary could just map flags to handlers e.g. -e -> EvalHandler,
--evaluate -> EvalHandler, etc.

Sean

--
View this message in context: 
http://forum.world.st/Command-Line-Handling-tp4612779.html
Sent from the Pharo Smalltalk mailing list archive at Nabble.com.

Reply via email to