#TUNING by exept
authorClaus Gittinger <cg@exept.de>
Sun, 08 Sep 2019 16:36:39 +0200
changeset 24765 e91461190d47
parent 24764 ce56ae39cae0
child 24766 9e09c9c8cb95
#TUNING by exept class: GetOpt changed: #parseOption:with:
GetOpt.st
--- a/GetOpt.st	Sun Sep 08 16:28:04 2019 +0200
+++ b/GetOpt.st	Sun Sep 08 16:36:39 2019 +0200
@@ -226,13 +226,13 @@
             block := self at: longOption ifAbsent:nil.
             block notNil ifTrue:[
                 "/ a long option; never take rest of option as argument
-                block arity = 1
-                    ifTrue:  [ ^ block value: longOption ]
-                    ifFalse: [ 
-                        rest atEnd
-                            ifTrue:  [self error: 'argument missing to option ' , longOption].
-                        ^ block value: longOption value: rest next
-                    ]
+                block argumentCount == 1 ifTrue:  [ 
+                    ^ block value: longOption 
+                ].
+                rest atEnd ifTrue:[
+                    self error: 'argument missing to option ' , longOption
+                ].
+                ^ block value: longOption value: rest next
             ]
         ].
         block isNil ifTrue:[