balena-cli
Version:
The official balena Command Line Interface
23 lines • 864 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.capitanoizeOclifUsage = capitanoizeOclifUsage;
exports.getCommandsFromManifest = getCommandsFromManifest;
exports.getCommandIdsFromManifest = getCommandIdsFromManifest;
function capitanoizeOclifUsage(oclifUsage) {
return (oclifUsage || '')
.toString()
.replace(/(?<=\s)[A-Z]+(?=(\s|$))/g, (match) => `<${match}>`)
.toLowerCase();
}
async function getCommandsFromManifest() {
const manifest = require('../../oclif.manifest.json');
if (manifest.commands == null) {
throw new Error('Commands section not found in manifest.');
}
return manifest.commands;
}
async function getCommandIdsFromManifest() {
const commands = await getCommandsFromManifest();
return Object.keys(commands);
}
//# sourceMappingURL=oclif-utils.js.map
;