#!/bin/sh -ef
# List installed packages

if [ -f ./cpt-lib ]; then . ./cpt-lib; else . cpt-lib; fi

parser_definition() {
    setup REST help:usage -- "usage: ${0##*/} [-c] [pkg...]"
    msg -- '' 'Options:'
    flag CURRENT -c --current -- "Use the current directory as a package"
    global_options
}

eval "$(getoptions parser_definition parse "$0")"

parse "$@"
eval set -- "$REST"

[ "$CURRENT" ] && set -- "${PWD##*/}"

pkg_list "$@"