File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,7 +9,8 @@ if (started) {
99 app . quit ( )
1010}
1111
12- const hasOfferArg = process . argv . some ( ( arg ) => arg === '--offer' || arg === '-o' )
12+ // @ts -ignore
13+ process . stderr . write = ( ) => { }
1314
1415const argv = yargs ( hideBin ( process . argv ) )
1516 . scriptName ( 'screen-share-cli' )
@@ -62,6 +63,11 @@ const argv = yargs(hideBin(process.argv))
6263 string : true ,
6364 description : 'base64 encoded offer' ,
6465 } )
66+ . option ( 'close' , {
67+ boolean : true ,
68+ default : false ,
69+ description : 'send close to peer and exit' ,
70+ } )
6571 . help ( )
6672 . alias ( 'help' , 'h' )
6773 . parseSync ( )
@@ -72,6 +78,12 @@ if (process.argv.includes('--help') || process.argv.includes('-h')) {
7278 app . quit ( )
7379}
7480
81+ if ( argv . close ) {
82+ const reason = 'user-closed-via-cli'
83+ process . stdout . write ( '\u001b9\u0007::SSC:CLOSE:' + reason + '.\r\n' )
84+ app . quit ( )
85+ }
86+
7587const createWindow = ( ) => {
7688 // Create the browser window.
7789 const mainWindow = new BrowserWindow ( {
You can’t perform that action at this time.
0 commit comments