aboutsummaryrefslogtreecommitdiff
path: root/src/cpt-list
blob: aaef8d9a62330d75e20b943986350ef8f327364b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/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 "$@"