#!/bin/sh

if [ $# -eq 1 ]; then
  if command -v "$1" >/dev/null 2>&1; then
    exit 0
  else
    exit 1
  fi
else
  if eval "$1" >/dev/null 2>&1; then
    printf "%s" "$2"
  else
    printf "%s" "$3"
  fi
fi
