cpt

Carbs Packaging Tools
git clone git://git.carbslinux.org/cpt
Log | Files | Refs | README | LICENSE

commit 0be5d7aad94eca74e207752caf51f7fd9f934179
parent 66ac98bcaa937f8ace171590510313e7ff883560
Author: Cem Keylan <cem@ckyln.com>
Date:   Mon,  5 Oct 2020 14:06:22 +0300

cpt-list: add options

Diffstat:
Msrc/cpt-list | 18++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/src/cpt-list b/src/cpt-list @@ -3,9 +3,19 @@ if [ -f ./cpt-lib ]; then . ./cpt-lib; else . cpt-lib; fi -case "$1" in - --help|-h) out "usage: ${0##*/} [pkg...]"; exit 1 ;; - --version|-v) version ;; -esac +parser_definition() { + setup REST -- "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")" +eval "$(getoptions_help parser_definition usage)" + +parse "$@" +eval set -- "$REST" + +[ "$CURRENT" ] && set -- "${PWD##*/}" pkg_list "$@"