#!/bin/sh

# shellcheck disable=SC2093,SC2154,SC2215

# Error out on undefined variables to catch typos or other errors such as env
# vars not being defined when you expected it (not enough systems do this!)
set -u

# exec replaces the process; prevents needless /bin/sh from dangling around.
exec prog \
    -a "${A}"          # Always include A from environment, error out if unset
    -b "${B:-d}"       # Include B from environment, use "d" if unset
    "${C:+-c "${C}"}"  # Only pass -c $C if $C is set, pass nothing at all if unset
    "$@"               # Include all argument passed to the shell script
