"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 sort-bed <file>');
        console.error('       OR pipe data via stdin: cat file.bed | jbrowse sort-bed');
        process.exit(1);
    }
}
function validateRequiredCommands() {
    const requiredCommands = ['sh', 'sort', 'grep'];
    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');
        process.exit(1);
    }
}
