>>109449610
Can you show me the human-readable way to do this in fish?
while [[ $# -gt 0 ]]; do
case "$1" in
-v|--verbose)
verbose=1
shift
;;
-o|--output)
if [[ -z "$2" || "$2" =~ ^- ]]; then
echo "Error: --output requires an argument" >&2
exit 1
fi
output_file="$2"
shift 2
;;
-h|--help)
echo "Usage: $0 [options] [input files...]"
echo " -v, --verbose Enable verbose output"
echo " -o, --output FILE Write output to FILE"
echo " -h, --help Show this help"
exit 0
;;
--)
shift
break
;;
-*)
echo "Error: Unknown option $1" >&2
exit 1
;;
*)
input_files+=("$1")
shift
;;
esac
done