Validate a document’s structure and check for common issues.

1. Usage

uniword validate FILE

2. Options

--verbose, -v

Show detailed validation results including empty paragraphs and empty tables.

3. Examples

Validate a document:

$ uniword validate document.docx

Validating document.docx...
  File format is valid
  Document structure is valid
  Document contains content

Validation complete!

Verbose output:

uniword validate document.docx --verbose

4. Checks performed

Check Description

File format

Verifies the file can be loaded without errors

Document structure

Calls doc.valid? to check structural integrity

Content presence

Confirms the document has paragraphs or tables

Empty paragraphs

Counts paragraphs with no text (verbose only)

Empty tables

Counts tables with no content (verbose only)

5. Exit codes

  • 0 — Document is valid

  • 1 — Validation failed