#!/bin/sh

# SPDX-FileCopyrightText: Copyright 2026 Daniel Hast
#
# SPDX-License-Identifier: Apache-2.0 OR MIT

cmd=$1
shift

while [ "$#" -gt 0 ]; do
    case "$1" in
        --status=*)
            status=$(( "${1#--status=}" ))
            shift
            ;;
        --delay=*)
            delay="${1#--delay=}"
            shift
            ;;
        *) break ;;
    esac
done

if [ -n "${delay-}" ]; then
    sleep "${delay}"
fi
echo "mock command: brew $cmd" "$@"
exit "${status-0}"
