#!/bin/bash

# ABSTRACT: Lists all packages installed matching a specification

source "${LIBDIR}/core-functions.sh" || exit 1

[[ $# == 1 ]] || die "Expected argument [atom] in: ${cmdname} [atom]"

set -euo pipefail

atom=$1

require_bin qlist app-portage/portage-utils

qlist --nocolor --installed --slots "${atom}"

# help: Invocation:
# help:   gentoo-perl installed-match-atom [atomspec]
# help:
# help: Example
# help:   gentoo-perl installed-match-atom "dev-lang/perl"
# help:
# help: Outputs:
# help:   A list of all installed packages matching the specification
# help:
