Skip to content

CLI returns exit code 0 on parse/validate/format errors #289

@ajitpratap0

Description

@ajitpratap0

Description

All CLI commands return exit code 0 even when they encounter errors. This breaks CI/CD integration.

Reproduction

gosqlx parse "INVALID SQL HERE"; echo $?  # prints error, exits 0
gosqlx validate "SELEC * FORM users"; echo $?  # prints error, exits 0
gosqlx parse ""; echo $?  # prints error, exits 0

Expected

Non-zero exit codes on errors (e.g., 1 for parse errors, 2 for usage errors).

Impact

The README claims "CI/CD integration with proper exit codes" but this doesn't work. Any pipeline using gosqlx for SQL validation will silently pass invalid SQL.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcli

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions