Skip to content

[Cross-cutting] Standardized exit codes across all apps #63

Description

@markcallen

Overview

Standardize exit codes across dev-cache, git-cleaner, and mac-cache-cleaner so scripts can reliably detect success, failure, and "nothing to do" states.

Implementation Plan

  1. Convention

    Code Meaning
    0 Success
    1 General error (config, flags, runtime)
    2 Nothing to clean / no findings (optional)
    3 Partial failure (some operations failed)
  2. Per-app behavior

    • dev-cache: 0 = success; 1 = config/init error; 2 = no findings when that's distinct
    • git-cleaner: Same
    • mac-cache-cleaner: Same; 3 = some targets failed
  3. Implementation

    • Replace os.Exit(1) with consistent codes
    • Document in README and --help
    • Scripts can branch: if [ $? -eq 2 ]; then echo "Nothing to clean"; fi

Acceptance Criteria

  • All apps use exit code 0 for success, 1 for error
  • Optionally 2 for "nothing to do", 3 for partial failure
  • Documented in README

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions