#!/usr/bin/env node /** * xml-validate CLI * ────────────────── * Usage * ───── * xml-validate [file2.xml ...] [options] * xml-validate - [options] # read XML from stdin * xml-validate --well-formed # well-formedness only, no XSD * * Options * ─────── * --format,-f Output format (default: text) * --output,-o Write output to file instead of stdout * --well-formed,-w Only check well-formedness (no XSD required) * --stdin Read XML from stdin (same as using '-' as xml file) * --no-warnings Suppress warnings * --max-errors Show at most n errors (0 = show all, default) * --max-warnings Show at most n warnings (0 = show all, default) * --no-summary Hide the summary line * --timing Show parse + validation duration * --json-indent Indent for json format (default: 2; 0 = minified) * --schema-dir Base directory for xs:import/xs:include resolution * --quiet,-q No output; use exit code only * --color / --no-color Force ANSI colour on/off * --exit-zero Always exit 0 * --watch Re-validate on file changes (requires inotify/FSEvents) * --code-frame Show source code frame for errors (requires source file) * -h, --help Show this help * -v, --version Show package version * * Exit codes * ────────── * 0 – valid (or --exit-zero) * 1 – validation errors found * 2 – usage / file error */ import { parseXsd } from '../xsd/XsdParser'; import { compileSchema } from '../pipeline/SchemaCompilerLite'; import { ValidationResult } from '../validator/ValidationResult'; export declare function getVersion(): string; export declare function printHelp(): void; type Format = 'text' | 'compact' | 'json' | 'github' | 'junit'; interface CliArgs { xmlFiles: string[]; xsdFile: string | null; format: Format; outputFile: string | null; wellFormed: boolean; fromStdin: boolean; quiet: boolean; showWarnings: boolean; maxErrors: number; maxWarnings: number; showSummary: boolean; jsonIndent: number; timing: boolean; schemaDir: string | null; color: boolean | undefined; exitZero: boolean; watch: boolean; codeFrame: boolean; /** A-07: use streaming SAX validation instead of DOM validation */ streaming: boolean; } export declare function parseArgs(argv: string[]): CliArgs; /** * Build a source code frame like: * * 14 | * 15 | abc * ^^^^^^^^^^^^^^^ * 16 | */ export declare function buildCodeFrame(source: string, line: number, col: number, contextLines?: number): string; /** * Append code frames to a formatted text result. */ export declare function appendCodeFrames(output: string, result: ValidationResult, xmlSource: string, useColor: boolean): string; export declare function formatResult(result: ValidationResult, cli: CliArgs, xmlFile: string, xmlSource?: string): string; export declare function validateOne(xmlSrc: string, xmlFile: string, cli: CliArgs, schema: ReturnType | null, /** NPERF-13: pre-compiled schema passed from caller to avoid re-compiling per file */ precompiledSchema?: ReturnType): Promise<{ result: ValidationResult; elapsedMs: number; }>; export declare function main(): Promise; export {}; //# sourceMappingURL=cli.d.ts.map