"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const printCmdHelp_1 = require("./printCmdHelp");
function printCliHelp(cli, info, hasMainCommand) {
    if (!hasMainCommand) {
        console.log(`usage: ${info.appName} {command} {...args}`);
        console.log(`version: ${info.version}`);
        console.log("");
    }
    if (hasMainCommand) {
        console.log("Available Commands");
    }
    else {
        console.log("Available Sub-Commands");
    }
    console.log("");
    for (const cmd of cli.cmds) {
        console.log(`  ${info.appName} ${printCmdHelp_1.getUsage(cmd)}  ${cmd.description || ""}`);
    }
    console.log("");
    console.log("Global Parameters");
    console.log("");
    console.log("  Required Parameters");
    printCmdHelp_1.printParameters("       ", Object.values(cli.globalNamedArgs).filter(v => !v.isOptional));
    console.log();
    console.log("  Optional Parameters");
    printCmdHelp_1.printParameters("       ", Object.values(cli.globalNamedArgs).filter(v => v.isOptional));
}
exports.printCliHelp = printCliHelp;
//# sourceMappingURL=printCliHelp.js.map