#!/bin/bash print_version_json() { local version="1.24.0" printf '{"version": "%s"}\n' "$version" } main() { if [[ "$1" == "version" && "$2" == "--json" ]]; then print_version_json elif [[ "$1" == "build" && "$7" == *"cli_test.tar.gz" ]]; then tarpath=$(echo "$7" | awk -F ':' '{print $2}') echo "Exporting image to a tarball (JK JUST A MOCK!)" echo "${tarpath}" touch $tarpath else echo 'Running buildah' fi } main "$@"