Skip to content

Commit 2b1e103

Browse files
authored
Fix server being booted twice (joe-re#150)
1 parent 02658c9 commit 2b1e103

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

packages/server/bin/cli.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import yargs from 'yargs'
22
import { hideBin } from 'yargs/helpers'
33
import { ConnectionMethod, createServer } from '../src/createServer'
44

5-
const cli = yargs(hideBin(process.argv))
5+
yargs(hideBin(process.argv))
66
.usage('SQL Language Server Command Line Interface')
77
.command('up', 'run sql-language-server', (v) => {
88
return v.option('method', {
@@ -22,13 +22,9 @@ const cli = yargs(hideBin(process.argv))
2222
process.stdin.resume()
2323
})
2424
.example('$0 up --method stdio', ': start up sql-language-server - communicate via stdio')
25+
.demandCommand()
2526
.help()
26-
27-
cli.parse()
28-
29-
if ((cli.argv as any)._.length === 0) {
30-
cli.showHelp()
31-
}
27+
.parse();
3228

3329
process.stdin.on('close', () => {
3430
process.exit(0);

0 commit comments

Comments
 (0)