"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const list_1 = require("@pnpm/list");
async function default_1(args, opts, command) {
    const output = await render(args, opts, command);
    if (output)
        console.log(output);
}
exports.default = default_1;
async function render(args, opts, command) {
    opts.long = opts.long || command === 'll' || command === 'la';
    const listOpts = {
        alwaysPrintRootPackage: opts.alwaysPrintRootPackage,
        depth: opts.depth || 0,
        include: opts.include,
        lockfileDirectory: opts.lockfileDirectory,
        long: opts.long,
        reportAs: (opts.parseable ? 'parseable' : (opts.json ? 'json' : 'tree')),
    };
    return args.length
        ? list_1.forPackages(args, opts.prefix, listOpts)
        : list_1.default(opts.prefix, listOpts);
}
exports.render = render;
