"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const strip_indent_1 = tslib_1.__importDefault(require("strip-indent"));
const arg_1 = tslib_1.__importDefault(require("arg"));
/**
 * format
 */
function format(input = '') {
    return strip_indent_1.default(input).trimRight() + '\n';
}
exports.format = format;
/**
 * Wrap arg to return an error instead of throwing
 */
function arg(argv, spec) {
    try {
        return arg_1.default(spec, { argv, stopAtPositional: true });
    }
    catch (err) {
        return err;
    }
}
exports.arg = arg;
/**
 * Check if result is an error
 */
function isError(result) {
    return result instanceof Error;
}
exports.isError = isError;
