"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const pnpm_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 only = (opts.production && opts.development ? undefined : (opts.production ? 'prod' : 'dev')); // tslint:disable-line:no-unnecessary-type-assertion
    const listOpts = {
        alwaysPrintRootPackage: opts.alwaysPrintRootPackage,
        depth: opts.depth || 0,
        long: opts.long,
        only,
        parseable: opts.parseable,
        shrinkwrapDirectory: opts.shrinkwrapDirectory,
    };
    return args.length
        ? pnpm_list_1.forPackages(args, opts.prefix, listOpts)
        : pnpm_list_1.default(opts.prefix, listOpts);
}
exports.render = render;
//# sourceMappingURL=list.js.map