Smalltalk.st
changeset 20717 e1080ea0677a
parent 20716 22b66345ba2e
child 20718 0159a28c02e5
equal deleted inserted replaced
20716:22b66345ba2e 20717:e1080ea0677a
  4451             ].
  4451             ].
  4452 
  4452 
  4453             (isEval | isPrint | isFilter | isRepl | isRunMain) ifTrue:[
  4453             (isEval | isPrint | isFilter | isRepl | isRunMain) ifTrue:[
  4454                 isRepl ifFalse:[
  4454                 isRepl ifFalse:[
  4455                     CommandLineArguments size <= idx ifTrue:[
  4455                     CommandLineArguments size <= idx ifTrue:[
       
  4456                         StandAlone := true.
  4456                         self exitWithErrorMessage:'missing argument after -E/-P/-F/--run.'.
  4457                         self exitWithErrorMessage:'missing argument after -E/-P/-F/--run.'.
  4457                     ].
  4458                     ].
  4458                     arg := CommandLineArguments at:idx + 1.
  4459                     arg := CommandLineArguments at:idx + 1.
  4459                     CommandLineArguments removeAtIndex:idx+1.
  4460                     CommandLineArguments removeAtIndex:idx+1.
  4460                 ].
  4461                 ].
  4478                     commandFiles do:[:commandFile |
  4479                     commandFiles do:[:commandFile |
  4479                         VerboseStartup == true ifTrue:[
  4480                         VerboseStartup == true ifTrue:[
  4480                             ('Smalltalk [info]: reading command file from: "', commandFile, '".') infoPrintCR.
  4481                             ('Smalltalk [info]: reading command file from: "', commandFile, '".') infoPrintCR.
  4481                         ].
  4482                         ].
  4482                         (self secureFileIn:commandFile) ifFalse:[
  4483                         (self secureFileIn:commandFile) ifFalse:[
       
  4484                             StandAlone := true.
  4483                             self exitWithErrorMessage:('"', commandFile, '" not found.').
  4485                             self exitWithErrorMessage:('"', commandFile, '" not found.').
  4484                         ]
  4486                         ]
  4485                     ]
  4487                     ]
  4486                 ].
  4488                 ].
  4487 
  4489 
  4534                                 |className class|
  4536                                 |className class|
  4535 
  4537 
  4536                                 className := arg.
  4538                                 className := arg.
  4537                                 class := Smalltalk classNamed:className.
  4539                                 class := Smalltalk classNamed:className.
  4538                                 class isNil ifTrue:[
  4540                                 class isNil ifTrue:[
       
  4541                                     StandAlone := true.
  4539                                     self exitWithErrorMessage:'no such class: "', className, '".'
  4542                                     self exitWithErrorMessage:'no such class: "', className, '".'
  4540                                 ].
  4543                                 ].
  4541                                 class := class theMetaclass.
  4544                                 class := class theMetaclass.
  4542                                 (class implements:#main:) ifTrue:[
  4545                                 (class implements:#main:) ifTrue:[
  4543                                     class main:CommandLineArguments.
  4546                                     class main:CommandLineArguments.
  4546                                         class main.
  4549                                         class main.
  4547                                     ] ifFalse:[    
  4550                                     ] ifFalse:[    
  4548                                         (class implements:#start) ifTrue:[
  4551                                         (class implements:#start) ifTrue:[
  4549                                             class start.
  4552                                             class start.
  4550                                         ] ifFalse:[    
  4553                                         ] ifFalse:[    
       
  4554                                             StandAlone := true.
  4551                                             self exitWithErrorMessage:'class has no "main:", "main" or "start" method.'
  4555                                             self exitWithErrorMessage:'class has no "main:", "main" or "start" method.'
  4552                                         ].    
  4556                                         ].    
  4553                                     ].    
  4557                                     ].    
  4554                                 ].    
  4558                                 ].    
  4555                             ].    
  4559                             ].