@launchql/cli
Version:
LaunchQL CLI
43 lines (39 loc) • 1.5 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.usageText = exports.extractFirst = void 0;
exports.displayVersion = displayVersion;
exports.displayUsage = displayUsage;
const chalk_1 = __importDefault(require("chalk"));
const package_1 = require("./package");
const extractFirst = (argv) => {
const first = argv._?.[0];
const newArgv = {
...argv,
_: argv._?.slice(1) ?? []
};
return { first, newArgv };
};
exports.extractFirst = extractFirst;
// Function to display the version information
function displayVersion() {
const pkg = (0, package_1.readAndParsePackageJson)();
console.log(chalk_1.default.green(`Name: ${pkg.name}`));
console.log(chalk_1.default.blue(`Version: ${pkg.version}`));
}
exports.usageText = `
Usage: launchql <command> [options]
Commands:
start Start the Launchql services.
version, -v Display the version of the Starship Client.
Configuration File:
--config <path> Specify the path to the configuration file containing the actual config file. Required.
Command-line options will override settings from this file if both are provided.
Additional Help:
$ launchql help Display this help information.
`;
function displayUsage() {
console.log(exports.usageText);
}