#!/usr/bin/env node
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const fs_1 = __importDefault(require("fs"));
const server_1 = __importDefault(require("./server"));
const args = process.argv.slice(2);
const help = `ReScript Language Server

Usage: rescript-language-server [options]

Options:

--stdio               Use stdio
--node-ipc            Use node-ipc
-v, --version         Print version
-h, --help            Print help`;
(() => {
    switch (args[0]) {
        case '--stdio':
            return (0, server_1.default)(true);
        case '--node-ipc':
            return (0, server_1.default)(false);
        case '--version':
        case '-v':
            console.log(JSON.parse(fs_1.default.readFileSync('./package.json', { encoding: 'utf8' })).version);
            process.exit(0);
        case '--help':
        case '-h':
            console.log(help);
            process.exit(0);
        default:
            console.log(help);
            process.exit(1);
    }
})();
//# sourceMappingURL=cli.js.map