#REFACTORING by cg
authorClaus Gittinger <cg@exept.de>
Fri, 13 Dec 2019 14:54:09 +0100
changeset 25108 69be6667933a
parent 25107 e5a2c223f111
child 25109 5e189dd05d1d
#REFACTORING by cg class: Smalltalk class comment/format in: #start changed: #initializeSystem
Smalltalk.st
--- a/Smalltalk.st	Fri Dec 13 14:51:39 2019 +0100
+++ b/Smalltalk.st	Fri Dec 13 14:54:09 2019 +0100
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "
  COPYRIGHT (c) 1988 by Claus Gittinger
 	      All Rights Reserved
@@ -632,10 +630,10 @@
      Here, a few specific initializations are done, then the actual initialization is
      done inside an error handler in basicInitializeSystem.
      Notice:
-	this is called by the VM's main entry. You will not find senders from Smalltalk.
+        this is called by the VM's main entry. You will not find senders from Smalltalk.
      Also Notice:
-	this is NOT called when an image is restarted;
-	in this case the show starts in Smalltalk>>restart."
+        this is NOT called when an image is restarted;
+        in this case the show starts in Smalltalk>>restart."
 
     |idx shellArgs|
 
@@ -645,7 +643,7 @@
     AbstractOperatingSystem initializeConcreteClass.
 
     CommandLineArguments isEmptyOrNil ifTrue:[
-	CommandLineArguments := #('stx') asOrderedCollection.
+        CommandLineArguments := #('stx') asOrderedCollection.
     ].
     CommandLine := CommandLineArguments copy.
     CommandLineArguments := CommandLineArguments asOrderedCollection.
@@ -655,6 +653,12 @@
     VerboseLoading := VerboseStartup := Verbose := false.
     DebuggingStandAlone := Debugging := false.
 
+    idx := CommandLineArguments indexOf:#('--version').
+    idx ~~ 0 ifTrue:[
+        self versionString _errorPrintCR.
+        self exit:0.
+    ].
+
     "/ if no argument was given, look for an environment variable named
     "/ STX_DEFAULT_ARGS. If set, take that.
     "/ if any argument was given, unless a --noShellArgs argument is given,
@@ -663,38 +667,38 @@
     "/ These allow for args like "--quick --infoPrint" to be automatically prepended
     idx := CommandLineArguments indexOfAny:#('--noShellArgs' '--noshellargs').
     (idx ~~ 0) ifTrue:[
-	CommandLineArguments removeIndex:idx.
+        CommandLineArguments removeIndex:idx.
     ] ifFalse:[
-	CommandLineArguments isEmpty ifTrue:[
-	    shellArgs := OperatingSystem getEnvironment:'STX_DEFAULT_ARGS'.
-	    shellArgs notEmptyOrNil ifTrue:[
-		shellArgs := shellArgs asCollectionOfWords.
-		CommandLineArguments addAll:shellArgs.
-	    ].
-	] ifFalse:[
-	    "/ prepend shell environment args from "STX_ARGS"
-	    shellArgs := OperatingSystem getEnvironment:'STX_MORE_ARGS'.
-	    shellArgs notEmptyOrNil ifTrue:[
-		shellArgs := shellArgs asCollectionOfWords.
-		CommandLineArguments addAllFirst:shellArgs.
-	    ].
-	].
+        CommandLineArguments isEmpty ifTrue:[
+            shellArgs := OperatingSystem getEnvironment:'STX_DEFAULT_ARGS'.
+            shellArgs notEmptyOrNil ifTrue:[
+                shellArgs := shellArgs asCollectionOfWords.
+                CommandLineArguments addAll:shellArgs.
+            ].
+        ] ifFalse:[
+            "/ prepend shell environment args from "STX_ARGS"
+            shellArgs := OperatingSystem getEnvironment:'STX_MORE_ARGS'.
+            shellArgs notEmptyOrNil ifTrue:[
+                shellArgs := shellArgs asCollectionOfWords.
+                CommandLineArguments addAllFirst:shellArgs.
+            ].
+        ].
     ].
 
     self initializeVerboseFlags.
 
     Error handle:[:ex |
-	StandAlone ifTrue:[
-	    DebuggingStandAlone ifFalse:[
-		'Startup Error - use "--debug" command line argument for more info' errorPrintCR.
-		Smalltalk exit:1.
-	    ].
-	    'Smalltalk [error]: Error during early initialization:' errorPrintCR.
-	    thisContext fullPrintAll.
-	].
-	ex reject.
+        StandAlone ifTrue:[
+            DebuggingStandAlone ifFalse:[
+                'Startup Error - use "--debug" command line argument for more info' errorPrintCR.
+                Smalltalk exit:1.
+            ].
+            'Smalltalk [error]: Error during early initialization:' errorPrintCR.
+            thisContext fullPrintAll.
+        ].
+        ex reject.
     ] do:[
-	self basicInitializeSystem
+        self basicInitializeSystem
     ].
 
     "Modified: / 12-10-2010 / 11:27:47 / cg"
@@ -8992,13 +8996,13 @@
     (lang == #de) ifTrue:[
         proto := 'Willkommen bei %1 (%4Version %2 von %3)'. bit := 'Bit'.
     ] ifFalse:[ (lang == #fr) ifTrue:[
-        proto := 'Salut, Bienvenue à %1 (%4version %2 de %3)'
+        proto := 'Salut, Bienvenue à %1 (%4version %2 de %3)'
     ] ifFalse:[ (lang == #it) ifTrue:[
         proto := 'Ciao, benvenuto al %1 (%4versione %2 di %3)'
     ] ifFalse:[ (lang == #es) ifTrue:[
         proto := 'Hola, bienvenida a %1 (%4version %2 de %3)'
     ] ifFalse:[ (lang == #pt) ifTrue:[
-        proto := 'Olá!!, mem-vindo a %1 (%4version %2 de %3)'
+        proto := 'Olá!!, mem-vindo a %1 (%4version %2 de %3)'
     ] ifFalse:[ (lang == #no) ifTrue:[
         proto := 'Hei, verdenmottakelse til %1 (%4versjon %2 av %3)'
     ]]]]]].