@@ -267,6 +267,22 @@ const addCypressRunCommand = (program) => {
267267 . option ( '--dev' , text ( 'dev' ) , coerceFalse )
268268}
269269
270+ const addCypressOpenCommand = ( program ) => {
271+ return program
272+ . command ( 'open' )
273+ . usage ( '[options]' )
274+ . description ( 'Opens Cypress in the interactive GUI.' )
275+ . option ( '-b, --browser <browser-path>' , text ( 'browserOpenMode' ) )
276+ . option ( '-c, --config <config>' , text ( 'config' ) )
277+ . option ( '-C, --config-file <config-file>' , text ( 'configFile' ) )
278+ . option ( '-d, --detached [bool]' , text ( 'detached' ) , coerceFalse )
279+ . option ( '-e, --env <env>' , text ( 'env' ) )
280+ . option ( '--global' , text ( 'global' ) )
281+ . option ( '-p, --port <port>' , text ( 'port' ) )
282+ . option ( '-P, --project <project-path>' , text ( 'project' ) )
283+ . option ( '--dev' , text ( 'dev' ) , coerceFalse )
284+ }
285+
270286/**
271287 * Casts known command line options for "cypress run" to their intended type.
272288 * For example if the user passes "--port 5005" the ".port" property should be
@@ -384,23 +400,12 @@ module.exports = {
384400 showVersions ( args )
385401 } )
386402
387- program
388- . command ( 'open' )
389- . usage ( '[options]' )
390- . description ( 'Opens Cypress in the interactive GUI.' )
391- . option ( '-b, --browser <browser-path>' , text ( 'browserOpenMode' ) )
392- . option ( '-c, --config <config>' , text ( 'config' ) )
393- . option ( '-C, --config-file <config-file>' , text ( 'configFile' ) )
394- . option ( '-d, --detached [bool]' , text ( 'detached' ) , coerceFalse )
395- . option ( '-e, --env <env>' , text ( 'env' ) )
396- . option ( '--global' , text ( 'global' ) )
397- . option ( '-p, --port <port>' , text ( 'port' ) )
398- . option ( '-P, --project <project-path>' , text ( 'project' ) )
399- . option ( '--dev' , text ( 'dev' ) , coerceFalse )
403+ addCypressOpenCommand ( program )
400404 . action ( ( opts ) => {
401405 debug ( 'opening Cypress' )
402406 require ( './exec/open' )
403407 . start ( util . parseOpts ( opts ) )
408+ . then ( util . exit )
404409 . catch ( util . logErrorExit1 )
405410 } )
406411
@@ -430,6 +435,7 @@ module.exports = {
430435 debug ( 'opening Cypress' )
431436 require ( './exec/open' )
432437 . start ( { ...util . parseOpts ( opts ) , testingType : 'component' } )
438+ . then ( util . exit )
433439 . catch ( util . logErrorExit1 )
434440 } )
435441
0 commit comments