Skip to content

Error handling: structured exit codes, --help and --version flags #7

@vmvarela

Description

@vmvarela

Description

The current tool exits with a generic message on bad input or SQL errors. Users deserve clear, actionable error output that helps them fix the problem — with exit codes that scripts can rely on.

Acceptance Criteria

  • Usage help is printed to stderr, not stdout
  • Exit code 0: success
  • Exit code 1: usage error (missing query argument)
  • Exit code 2: CSV parse error (with row number)
  • Exit code 3: SQL error (with the sqlite3 error message)
  • --help / -h flag prints usage details
  • --version / -V flag prints the binary version (injected at build time)
  • All error messages are prefixed with error: and go to stderr

Notes

  • Version can be injected via build.zig using exe.root_module.addAnonymousImport or -Dversion option
  • std.process.exit codes should be documented in the README

Metadata

Metadata

Assignees

No one assigned

    Labels

    mvpPart of the Minimum Viable Productpriority:highMust be in the next sprintsize:sSmall — 1 to 4 hoursstatus:readyRefined and ready for sprint selectiontype:featureNew functionality

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions