"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateFileArgument = validateFileArgument;
exports.validateRequiredCommands = validateRequiredCommands;
const command_exists_1 = require("command-exists");
function validateFileArgument(file) {
    // Allow no file argument for stdin input
    if (!file && process.stdin.isTTY) {
        console.error('Error: Missing required argument: file');
        console.error('Usage: jbrowse make-pif <file> [options]');
        console.error('       OR pipe data via stdin: cat file.paf | jbrowse make-pif');
        process.exit(1);
    }
}
function validateRequiredCommands() {
    const requiredCommands = ['sh', 'sort', 'grep', 'tabix', 'bgzip'];
    const missingCommands = requiredCommands.filter(cmd => !(0, command_exists_1.sync)(cmd));
    if (missingCommands.length > 0) {
        console.error('Error: Unable to sort, requires unix type environment with sort, grep, bgzip, tabix');
        process.exit(1);
    }
}
