Skip to content

refactor: move exit codes to shared package #15

@rianjs

Description

@rianjs

Summary

Create a shared exit code package for consistent error handling across both CLI tools.

Current State

  • jtk has internal/exitcode/exitcode.go with well-defined exit codes
  • cfl uses os.Exit(1) without structured exit codes

Proposed Changes

  1. Move tools/jtk/internal/exitcode/ to shared/exitcode/
  2. Update jtk imports to use shared package
  3. Update cfl to use shared exit codes instead of hardcoded values

Exit Codes

const (
    Success         = 0
    GeneralError    = 1
    UsageError      = 2
    ConfigError     = 3
    APIError        = 4
    NotFoundError   = 5
    AuthError       = 6
)

Impact

Consistent exit codes enable better scripting and error handling for users of both tools.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions