Files
libhalo/cli/entry_cli.js

27 lines
685 B
JavaScript

/**
* LibHaLo - Programmatically interact with HaLo tags from the web browser, mobile application or the desktop.
* Copyright by Arx Research, Inc., a Delaware corporation
* License: MIT
*/
const {parseArgs} = require('./args_cli.js');
const {runHalo} = require("./cli");
const {printVersionInfo, getVersionInfo} = require("./version");
let args = parseArgs();
if (args && args.name === "cli_version") {
if (args.output === "json") {
let versionInfo = getVersionInfo() ?? {};
console.log(JSON.stringify(versionInfo));
} else {
printVersionInfo();
}
}
if (!args || args.name === "cli_version") {
process.exit(0);
}
runHalo("cli", args);