#!/usr/bin/env bash
#set -eo pipefail

if [[ "$1" == "-h" || "$1" == "--help" ]]; then
    cat <<EOF
Usage: $(basename "$0") [-h] <command>

Show detailed information about a command.

Options:
    -h, --help    Show this help message

Arguments:
    command       Command to investigate

EOF
    exit 0
fi

set -x

type "$1" 2>/dev/null
type -t "$1" 2>/dev/null
type -a "$1" 2>/dev/null
type -P "$1" 2>/dev/null
which -a "$1" 2>/dev/null
which "$1" \
    && file -b "$(which "$1")" \
    && file -L "$(which "$1")"
type -a "$1" 2>/dev/null
command -v "$1"
whereis "$1"
