function main()

in src/updateConfig.ts [23:59]


function main() {
    const args = yargs
        .usage(`\`$0 --dt=path-to-dt\` or \`$0 --package=path-to-dt-package\`
'dt.json' is used as the base tslint config for running the linter.`)
        .option("package", {
            describe: "Path of DT package.",
            type: "string",
            conflicts: "dt",
        })
        .option("dt", {
            describe: "Path of local DefinitelyTyped repository.",
            type: "string",
            conflicts: "package",
        })
        .option("rules", {
            describe: "Names of the rules to be updated. Leave this empty to update all rules.",
            type: "array",
            string: true,
            default: [] as string[],
        })
        .check(arg => {
            if (!arg.package && !arg.dt) {
                throw new Error("You must provide either argument 'package' or 'dt'.");
            }
            const unsupportedRules = arg.rules.filter(rule => ignoredRules.includes(rule));
            if (unsupportedRules.length > 0) {
                throw new Error(`Rules ${unsupportedRules.join(", ")} are not supported at the moment.`);
            }
            return true;
        }).argv;

    if (args.package) {
        updatePackage(args.package, dtConfig(args.rules));
    } else if (args.dt) {
        updateAll(args.dt, dtConfig(args.rules));
    }
}