confz

git mirror of https://ccx.te2000.cz/bzr/confz
git clone https://ccx.te2000.cz/git/confz
Log | Files | Refs

commit d69418dfc45c813806000d115016269402f5319b
parent a6c8166ffbe41357b99e8127b4e9c98a64e0cb33
Author: Jan Pobrislo <ccx@webprojekty.cz>
Date:   Wed, 14 Feb 2018 21:13:10 +0100

Add option to extend fpath
Diffstat:
Mbin/confz | 17+++++++++++++++++
1 file changed, 17 insertions(+), 0 deletions(-)

diff --git a/bin/confz b/bin/confz @@ -4,6 +4,7 @@ autoload -Uz colors; colors setopt extended_glob warn_create_global no_unset +zmodload zsh/zutil typeset -gA vars vars_prev typeset -ga do_command actions_performed @@ -18,6 +19,22 @@ die() { exit 1 } +confz_print_usage() { + echo >&2 "usage: $0:h [-f <fpath>] <requirement> [<args>] [; <requirement> ...]" + exit 2 +} + +# option parsing +typeset -ga confz_opt_f +zparseopts -D - f+:=confz_opt_f || die "Unable to parse options" +() { + local opt val + for opt val in "$confz_opt_f[@]"; do + [[ $opt == "-"* ]] || die "Something went wrong" + fpath=( $val "$fpath[@]" ) + done +} + # trace-printing helpers confz_check_start() { print -r - "${confz_indent}checking $fg_bold[default]$1$reset_color ${(@q)argv[2,-1]} ${reset_color}[" >&2