@@ -152,7 +152,10 @@ export class SolidityLauncher {
152152 const additionalOptions = { } ; // TODO
153153 setupOptions ( this . _program , additionalOptions ) ;
154154
155- const args = process . argv . slice ( process . argv . indexOf ( this . _program ) + 1 ) ;
155+ const index = process . argv . indexOf ( process . argv . find ( ( a ) => a . includes ( this . _program ) ) )
156+
157+ const args = process . argv . slice ( index + 1 ) ;
158+
156159 const myConfig = loadConfig ( args ) ;
157160
158161 processConfig ( myConfig , args ) ;
@@ -187,14 +190,14 @@ export class SolidityLauncher {
187190 getUserInterface ( ) . report ( "asciiArt" , [ "Syntest" ] ) ;
188191 getUserInterface ( ) . report ( "version" , [ require ( "../package.json" ) . version ] ) ;
189192
190- if ( this . config . help ) {
193+ this . truffle = loadLibrary ( this . config ) ;
194+ this . api = new API ( myConfig ) ;
195+
196+ if ( args . includes ( "--help" ) || args . includes ( "-h" ) ) {
191197 getUserInterface ( ) . report ( "help" , [ ] ) ;
192198 await this . exit ( ) ;
193199 } // Exit if --help
194200
195- this . truffle = loadLibrary ( this . config ) ;
196- this . api = new API ( myConfig ) ;
197-
198201 setNetwork ( this . config , this . api ) ;
199202
200203 // Server launch
@@ -206,24 +209,19 @@ export class SolidityLauncher {
206209 const nodeInfo = await web3 . eth . getNodeInfo ( ) ;
207210 const ganacheVersion = nodeInfo . split ( "/" ) [ 1 ] ;
208211
209- setNetworkFrom ( this . config , accounts ) ;
210-
211212 // Exit if --version
212- if ( this . config . version ) {
213+ if ( args . includes ( "-- version" ) || args . includes ( "-v" ) ) {
213214 getUserInterface ( ) . report ( "versions" , [
214215 this . truffle . version ,
215216 ganacheVersion ,
216217 pkg . version ,
217- ] ) ; // Exit if --help
218-
219- // Finish
220- await tearDownTempFolders ( this . tempContractsDir , this . tempArtifactsDir ) ;
218+ ] ) ;
221219
222- // Shut server down
223- await this . api . finish ( ) ;
224220 await this . exit ( ) ;
225221 }
226222
223+ setNetworkFrom ( this . config , accounts ) ;
224+
227225 getUserInterface ( ) . report ( "header" , [ "GENERAL INFO" ] ) ;
228226
229227 getUserInterface ( ) . report ( "property-set" , [
0 commit comments