zsh: overhauled shell completion for prt-get, added rest of pkgutils, updated zsh-lovers.1
This commit is contained in:
parent
8b5665db83
commit
c5e1709c36
|
@ -1251,4 +1251,9 @@ lrwxrwxrwx root/root usr/share/zsh/5.9/help/which -> whence
|
||||||
drwxr-xr-x root/root usr/share/zsh/5.9/scripts/
|
drwxr-xr-x root/root usr/share/zsh/5.9/scripts/
|
||||||
-rw-r--r-- root/root usr/share/zsh/5.9/scripts/newuser
|
-rw-r--r-- root/root usr/share/zsh/5.9/scripts/newuser
|
||||||
drwxr-xr-x root/root usr/share/zsh/site-functions/
|
drwxr-xr-x root/root usr/share/zsh/site-functions/
|
||||||
|
-rw-r--r-- root/root usr/share/zsh/site-functions/_pkgadd
|
||||||
|
-rw-r--r-- root/root usr/share/zsh/site-functions/_pkginfo
|
||||||
|
-rw-r--r-- root/root usr/share/zsh/site-functions/_pkgmk
|
||||||
|
-rw-r--r-- root/root usr/share/zsh/site-functions/_pkgrm
|
||||||
-rw-r--r-- root/root usr/share/zsh/site-functions/_prt-get
|
-rw-r--r-- root/root usr/share/zsh/site-functions/_prt-get
|
||||||
|
-rw-r--r-- root/root usr/share/zsh/site-functions/_rejmerge
|
||||||
|
|
|
@ -1,7 +1,12 @@
|
||||||
untrusted comment: verify with /etc/ports/opt.pub
|
untrusted comment: verify with /etc/ports/opt.pub
|
||||||
RWSE3ohX2g5d/ZfhkJ+2R4QmpFyCgNVVczdY3WkgjBgLGy6ALYnyAaNHgfTBEaoir5sVZMj4Rq5erIz5doi0q/A3aiu5ExgdVg4=
|
RWSE3ohX2g5d/S9Tqrkxft/1NSk5QWMI1tIiAEcdbFu8+ahnWth653mt0fOtupguGgIf554AtBdtdZyLeNESfsBFhEaI/nkJvAA=
|
||||||
SHA256 (Pkgfile) = 3c8cd5af47066fe2e601be31180d7abd68d01d802aa6891beb24b1b55c8ddc59
|
SHA256 (Pkgfile) = 290c58811adfa5c2670b2680e4c7d97900e5e673bcb50a79781dbee10aaae65f
|
||||||
SHA256 (.footprint) = e6b46e0a1ae2ab41c0d350db30e9195d0402cb369139bc0d97daefb8007d8868
|
SHA256 (.footprint) = f4bf0634a73205ac5c1ae0739ef230cbbf6867bd012755e13da4ed8da30a838b
|
||||||
SHA256 (zsh-5.9.tar.xz) = 9b8d1ecedd5b5e81fbf1918e876752a7dd948e05c1a0dba10ab863842d45acd5
|
SHA256 (zsh-5.9.tar.xz) = 9b8d1ecedd5b5e81fbf1918e876752a7dd948e05c1a0dba10ab863842d45acd5
|
||||||
SHA256 (_prt-get) = de2e23df932f0c855c0e34389cc8a3d1083b30114f437cb77cb19df2a261b21c
|
SHA256 (_prt-get) = a0ffcbe04f9a217543e8923b20c676bf8ea6864dbc4037a3e1afe41e0b33ff91
|
||||||
SHA256 (zsh-lovers.1) = b40802dd83f1f2eded9823776ae90af8e0b91488e97f98b3a0629f8d11953e81
|
SHA256 (_pkgadd) = 2d1e07012c72e6eeabdb4298e985ed27b8eebd25030f4f3703ae1c344ab5eeec
|
||||||
|
SHA256 (_pkgmk) = 1499c43d5092d98dfa3ed07be6388735ed4f0e43608e26eedd3cf95494c5801d
|
||||||
|
SHA256 (_pkginfo) = 90d7e38e0982271133d5a9a6ff436830e6c7669c4d3b47bcca49e33bfbdd9f7f
|
||||||
|
SHA256 (_pkgrm) = cdd2bc5097cfc5c57592b677dee39f5ff4ae065e04997fa628367977068d4458
|
||||||
|
SHA256 (_rejmerge) = d9060208a9f26c88bfe96f734cdbd461252dcbc413782c947a3a2a0e25e82d38
|
||||||
|
SHA256 (zsh-lovers.1) = c13688b37897c98d2593826b0ab7606927a28998d73ff0c8a2a4d07dad93944a
|
||||||
|
|
21
zsh/Pkgfile
21
zsh/Pkgfile
|
@ -5,9 +5,10 @@
|
||||||
|
|
||||||
name=zsh
|
name=zsh
|
||||||
version=5.9
|
version=5.9
|
||||||
release=1
|
release=2
|
||||||
source=(https://www.zsh.org/pub/$name-$version.tar.xz
|
source=(https://www.zsh.org/pub/$name-$version.tar.xz
|
||||||
_prt-get zsh-lovers.1)
|
_prt-get _pkgadd _pkgmk _pkginfo _pkgrm _rejmerge
|
||||||
|
zsh-lovers.1)
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
cd $name-$version
|
cd $name-$version
|
||||||
|
@ -16,10 +17,7 @@ build() {
|
||||||
sed -i 's#/usr/share/keymaps#/usr/share/kbd/keymaps#g' Completion/Unix/Command/_loadkeys
|
sed -i 's#/usr/share/keymaps#/usr/share/kbd/keymaps#g' Completion/Unix/Command/_loadkeys
|
||||||
sed -i 's#/usr/share/misc/usb.ids#/usr/share/usb.ids#g' Completion/Linux/Command/_lsusb
|
sed -i 's#/usr/share/misc/usb.ids#/usr/share/usb.ids#g' Completion/Linux/Command/_lsusb
|
||||||
|
|
||||||
# fix a bug in recent glibc versions (2.16)
|
sed -e 's|^\.NOTPARALLEL|#.NOTPARALLEL|' -i 'Config/defs.mk.in'
|
||||||
sed -e '/#include "attr.mdh"/d;/#include "attr.pro/d' \
|
|
||||||
-e 's|\(#include <sys/xattr.h>\)|\1\n#include "attr.mdh"\n#include "attr.pro"|g' \
|
|
||||||
-i Src/Modules/attr.c
|
|
||||||
|
|
||||||
for _fpath in AIX Cygwin Darwin Debian Mandriva openSUSE Redhat Solaris; do
|
for _fpath in AIX Cygwin Darwin Debian Mandriva openSUSE Redhat Solaris; do
|
||||||
rm -rf Completion/$_fpath
|
rm -rf Completion/$_fpath
|
||||||
|
@ -28,6 +26,8 @@ build() {
|
||||||
rm -f Completion/Linux/Command/_{pkgtool,rpmbuild,yast}
|
rm -f Completion/Linux/Command/_{pkgtool,rpmbuild,yast}
|
||||||
rm -f Completion/Unix/Command/_{osc,systemd}
|
rm -f Completion/Unix/Command/_{osc,systemd}
|
||||||
|
|
||||||
|
rm Doc/version.yo
|
||||||
|
|
||||||
./configure \
|
./configure \
|
||||||
--prefix=/usr \
|
--prefix=/usr \
|
||||||
--sysconfdir=/etc \
|
--sysconfdir=/etc \
|
||||||
|
@ -49,7 +49,9 @@ build() {
|
||||||
--enable-multibyte \
|
--enable-multibyte \
|
||||||
--enable-zsh-secure-free
|
--enable-zsh-secure-free
|
||||||
|
|
||||||
make
|
make -C Src headers
|
||||||
|
make -C Src -f Makemod zsh{path,xmod}s.h version.h
|
||||||
|
make all
|
||||||
make DESTDIR=$PKG install
|
make DESTDIR=$PKG install
|
||||||
|
|
||||||
install -m 644 $SRC/zsh-lovers.1 $PKG/usr/share/man/man1/
|
install -m 644 $SRC/zsh-lovers.1 $PKG/usr/share/man/man1/
|
||||||
|
@ -62,4 +64,9 @@ build() {
|
||||||
rm $PKG/usr/share/zsh/$version/functions/Completion/Unix/_pkg{add,rm,info}
|
rm $PKG/usr/share/zsh/$version/functions/Completion/Unix/_pkg{add,rm,info}
|
||||||
|
|
||||||
install -m 644 -t $PKG/usr/share/zsh/site-functions $SRC/_prt-get
|
install -m 644 -t $PKG/usr/share/zsh/site-functions $SRC/_prt-get
|
||||||
|
install -m 644 -t $PKG/usr/share/zsh/site-functions $SRC/_pkgadd
|
||||||
|
install -m 644 -t $PKG/usr/share/zsh/site-functions $SRC/_pkgmk
|
||||||
|
install -m 644 -t $PKG/usr/share/zsh/site-functions $SRC/_pkginfo
|
||||||
|
install -m 644 -t $PKG/usr/share/zsh/site-functions $SRC/_pkgrm
|
||||||
|
install -m 644 -t $PKG/usr/share/zsh/site-functions $SRC/_rejmerge
|
||||||
}
|
}
|
||||||
|
|
19
zsh/_pkgadd
Normal file
19
zsh/_pkgadd
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
#compdef pkgadd
|
||||||
|
|
||||||
|
_packages() {
|
||||||
|
local -a list
|
||||||
|
DIR=$(/usr/bin/grep -e "^PKGMK_PACKAGE_DIR" /etc/pkgmk.conf &> /dev/null | cut -d = -f 2 | sed 's/\"//g')
|
||||||
|
for i in $DIR/*.pkg.tar.*; do
|
||||||
|
list+=($(echo "$i"))
|
||||||
|
done
|
||||||
|
_describe 'packages' list
|
||||||
|
}
|
||||||
|
|
||||||
|
_arguments -s \
|
||||||
|
'(-u --upgrade)'{-u,--upgrade}'[upgrade package with the same name]' \
|
||||||
|
'(-f --force)'{-f,--force}'[force install, overwrite conflicting files]' \
|
||||||
|
'(-r --root)'{-r,--root}'[specify alternative installation root]:root directory:_files -/' \
|
||||||
|
'(-c --config)'{-c,--config}'[use alternate configuration file]:config-file:_files' \
|
||||||
|
'(-v --version)'{-v,--version}'[print version and exit]' \
|
||||||
|
'(-h --help)'{-h,--help}'[print help and exit]' \
|
||||||
|
'*:package:_packages'
|
10
zsh/_pkginfo
Normal file
10
zsh/_pkginfo
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
#compdef pkginfo
|
||||||
|
|
||||||
|
_arguments \
|
||||||
|
'(-i --installed)'{-i,--installed}'[show installed packages]' \
|
||||||
|
'(-l --list)'{-l,--list}'[list files in package]:package:_files' \
|
||||||
|
'(-o --owner)'{-o,--owner}'[list owner(s) of file(s) matching pattern]:pattern:_files' \
|
||||||
|
'(-f --footprint)'{-f,--footprint}'[print footprint for file]:file:_files' \
|
||||||
|
'(-r --root)'{-r,--root}'[specify alternative installation root]:root:_directories' \
|
||||||
|
'(-v --version)'{-v,--version}'[print version and exit]' \
|
||||||
|
'(-h --help)'{-h,--help}'[print help and exit]'
|
29
zsh/_pkgmk
Normal file
29
zsh/_pkgmk
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
#compdef pkgmk
|
||||||
|
|
||||||
|
_arguments -s \
|
||||||
|
'(-i --install)'{-i,--install}'[build and install package]' \
|
||||||
|
'(-u --upgrade)'{-u,--upgrade}'[build and install package (as upgrade)]' \
|
||||||
|
'(-r --recursive)'{-r,--recursive}'[search for and build packages recursively]' \
|
||||||
|
'(-d --download)'{-d,--download}'[download missing source file(s)]' \
|
||||||
|
'(-do --download-only)'{-do,--download-only}'[do not build, only download missing source file(s)]' \
|
||||||
|
'(-eo --extract-only)'{-eo,--extract-only}'[do not build, only extract source file(s)]' \
|
||||||
|
'(-utd --up-to-date)'{-utd,--up-to-date}'[do not build, only check if package is up to date]' \
|
||||||
|
'(-uf --update-footprint)'{-uf,--update-footprint}'[update footprint using result from last build]' \
|
||||||
|
'(-if --ignore-footprint)'{-if,--ignore-footprint}'[build package without checking footprint]' \
|
||||||
|
'(-in --ignore-new)'{-in,--ignore-new}'[build package, ignore new files in a footprint missmatch]' \
|
||||||
|
'(-um --update-md5sum)'{-um,--update-md5sum}'[update md5sum]' \
|
||||||
|
'(-im --ignore-md5sum)'{-im,--ignore-md5sum}'[build package without checking md5sum]' \
|
||||||
|
'(-cm --check-md5sum)'{-cm,--check-md5sum}'[do not build, only check md5sum]' \
|
||||||
|
'(-us --update-signature)'{-us,--update-signature}'[update signature including sha256 checksums]' \
|
||||||
|
'(-cs --check-signature)'{-cs,--check-signature}'[check the validity of the port files]' \
|
||||||
|
'(-is --ignore-signature)'{-is,--ignore-signature}'[build package without checking the signature]' \
|
||||||
|
'(-rs --refresh-signature)'{-rs,--refresh-signature}'[create new signature and keep existing sha256 checksums]' \
|
||||||
|
'(-sk --secret-key)'{-sk,--secret-key}'[use <file> to sign the port]:secret-key:' \
|
||||||
|
'(-pk --public-key)'{-pk,--public-key}'[check the port signature using public-key <file>]:public-key:' \
|
||||||
|
'(-ns --no-strip)'{-ns,--no-strip}'[do not strip executable binaries or libraries]' \
|
||||||
|
'(-f --force)'{-f,--force}'[build package even if it appears to be up to date]' \
|
||||||
|
'(-c --clean)'{-c,--clean}'[remove package and downloaded files]' \
|
||||||
|
'(-kw --keep-work)'{-kw,--keep-work}'[keep temporary working directory]' \
|
||||||
|
'(-cf --config-file)'{-cf,--config-file}'[use alternative configuration file]:config-file:_files' \
|
||||||
|
'(-v --version)'{-v,--version}'[print version and exit]' \
|
||||||
|
'(-h --help)'{-h,--help}'[print help and exit]'
|
7
zsh/_pkgrm
Normal file
7
zsh/_pkgrm
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
#compdef pkgrm
|
||||||
|
|
||||||
|
_arguments -s \
|
||||||
|
'-r[specify alternative installation root]:root:_directories' \
|
||||||
|
'-v[print version and exit]' \
|
||||||
|
'-h[print help and exit]' \
|
||||||
|
'*:package:_files'
|
380
zsh/_prt-get
380
zsh/_prt-get
|
@ -1,123 +1,297 @@
|
||||||
#compdef prt-get prt-cache
|
#compdef prt-get prt-cache
|
||||||
|
|
||||||
local curcontext="$curcontext" expl ret=1 subcmd
|
_commands=(
|
||||||
|
help:'show this help'
|
||||||
|
version:'show the current version'
|
||||||
|
list:'show a list of available ports'
|
||||||
|
printf:'print formatted list of available ports'
|
||||||
|
listinst:'show a list of installed ports'
|
||||||
|
listorphans:'list of ports with no packages depending on them'
|
||||||
|
info:'show info about a port'
|
||||||
|
path:'show path of a port'
|
||||||
|
readme:'show a port'"'"'s readme file (if it exists)'
|
||||||
|
dup:'find duplicate ports'
|
||||||
|
isinst:'print whether ports are installed'
|
||||||
|
current:'print installed version of port'
|
||||||
|
diff:'list outdated packages (or check args for change)'
|
||||||
|
quickdiff:'same as diff but simple format'
|
||||||
|
depends:'show dependencies for these ports'
|
||||||
|
quickdep:'same as depends but simple format'
|
||||||
|
deptree:'show dependencies tree for <port>'
|
||||||
|
dependent:'show installed packages which depend on '"'"'port'"'"''
|
||||||
|
search:'show port names containing '"'"'expr'"'"''
|
||||||
|
dsearch:'show ports containing '"'"'expr'"'"' in the name or description'
|
||||||
|
fsearch:'show file names in footprints matching '"'"'pattern'"'"''
|
||||||
|
install:'install ports'
|
||||||
|
update:'update ports'
|
||||||
|
grpinst:'install ports, stop on error'
|
||||||
|
depinst:'install ports and their dependencies'
|
||||||
|
remove:'remove ports'
|
||||||
|
sysup:'update all outdated ports'
|
||||||
|
lock:'lock current version of packages'
|
||||||
|
unlock:'unlock packages'
|
||||||
|
listlocked:'list locked packages'
|
||||||
|
ls:'print a listing of the port'"'"'s directory'
|
||||||
|
cat:'print out '"'"'port/file'"'"''
|
||||||
|
edit:'edit '"'"'port/file'"'"''
|
||||||
|
)
|
||||||
|
|
||||||
_list_notinstalled() {
|
# Options Information
|
||||||
local liste expl pkgs
|
_infooptions=(
|
||||||
local -a disp
|
"--depsort[Sort by dependencies]"
|
||||||
|
)
|
||||||
|
|
||||||
installed=($(prt-cache listinst))
|
# Options for Differences / Check for updates
|
||||||
pkgs=($(prt-cache list))
|
_diffoptions=(
|
||||||
pkgs=(${pkgs:#${(j:|:)~${installed:q}}})
|
"--all[display locked ports too]"
|
||||||
|
"--prefer-higher[prefer higher installed versions over lower ports]"
|
||||||
|
"--strict-diff[override prefer higher configuration setting]"
|
||||||
|
)
|
||||||
|
|
||||||
_wanted packages expl 'packages' \
|
# Options for Dependencies
|
||||||
compadd "$@" "$disp[@]" - "${(@)pkgs%%:*}"
|
_depoptions=(
|
||||||
|
"--all[list all dependent packages, not only installed]"
|
||||||
|
"--recursive[print recursive listing]"
|
||||||
|
"--tree[print recursive tree listing]"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Options for Install, Update and Removal
|
||||||
|
_installoptions=(
|
||||||
|
"-f[force installation]"
|
||||||
|
"-fi[force installation]"
|
||||||
|
"-fr[force rebuild]"
|
||||||
|
"-uf[update footprint]"
|
||||||
|
"-if[ignore footprint]"
|
||||||
|
"-um[update md5sum]"
|
||||||
|
"-im[ignore md5sum]"
|
||||||
|
"-us[update signature]"
|
||||||
|
"-is[ignore signature]"
|
||||||
|
"--margs=[pass 'string' to pkgmk]"
|
||||||
|
"--aargs=[pass 'string' to pkgadd]"
|
||||||
|
"--rargs=[pass 'string' to pkgrm]"
|
||||||
|
"--test[test mode]"
|
||||||
|
"--log[write log file]"
|
||||||
|
"--ignore=[Don't install/update those packages]:ignored packages:_allports"
|
||||||
|
"--pre-install[execute pre-install script]"
|
||||||
|
"--post-install[execute post-install script]"
|
||||||
|
"--install-scripts[execute pre-install and post-install script]"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Options for System Update
|
||||||
|
_sysupoptions=(
|
||||||
|
"--nodeps[don't sort by dependencies]"
|
||||||
|
"--test[test mode]"
|
||||||
|
"--log[write log file]"
|
||||||
|
"--prefer-higher[prefer higher installed versions over lower ones in ports tree]"
|
||||||
|
"--strict-diff[override prefer higher configuration setting]"
|
||||||
|
)
|
||||||
|
|
||||||
|
_printfoptions=(
|
||||||
|
'%n[name]'
|
||||||
|
'%p[path]'
|
||||||
|
'%v[version]'
|
||||||
|
'%r[release]'
|
||||||
|
'%d[description]'
|
||||||
|
'%e[dependencies]'
|
||||||
|
'%u[URL]'
|
||||||
|
'%P[Packager]'
|
||||||
|
'%M[Maintainer]'
|
||||||
|
'%R[Readme]'
|
||||||
|
'%E[pre-install script]'
|
||||||
|
'%O[post-install script]'
|
||||||
|
'%l[is locked]'
|
||||||
|
'%i[installed]'
|
||||||
|
)
|
||||||
|
|
||||||
|
# Options for General Options
|
||||||
|
_options=(
|
||||||
|
"-v[Show version in listing]"
|
||||||
|
"-vv[Show version and decription in listing]"
|
||||||
|
"--path[Print path to port if appropriate (search, list, depends)]"
|
||||||
|
"--cache[Use a cache file]"
|
||||||
|
"--config=[Use alternative configuration file]:file:_files"
|
||||||
|
"--install-root=[Use alternative install root directory]:directory:_directories"
|
||||||
|
"--no-std-config[Don't parse default configuration file]"
|
||||||
|
"--config-prepend=[Prepend '..' to configuration]:directory:_directories"
|
||||||
|
"--config-append=[Append '..' to configuration]:directory:_directories"
|
||||||
|
"--config-set=[Set configuration data '..', overriding config file]:data"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Port list generators
|
||||||
|
_allports() {
|
||||||
|
local -a list
|
||||||
|
list=(${(f)"$(prt-get list 2>/dev/null)"})
|
||||||
|
_describe 'ports' list
|
||||||
}
|
}
|
||||||
|
|
||||||
_list() {
|
_installedports() {
|
||||||
local liste expl pkgs installed
|
local -a list
|
||||||
local -a disp
|
list=(${(f)"$(prt-get listinst 2>/dev/null)"})
|
||||||
|
_describe 'installedports' list
|
||||||
pkgs=($(prt-cache list))
|
|
||||||
|
|
||||||
_wanted packages expl 'packages' \
|
|
||||||
compadd "$@" "$disp[@]" - "${(@)pkgs%%:*}"
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_listinstalled() {
|
_notinstalledports() {
|
||||||
local liste expl pkgs installed
|
local -a installed_ports all_ports not_installed_ports
|
||||||
local -a disp
|
installed_ports=(${(f)"$(prt-cache listinst 2>/dev/null)"})
|
||||||
|
all_ports=(${(f)"$(prt-cache list 2>/dev/null)"})
|
||||||
pkgs=($(prt-cache listinst))
|
not_installed_ports=(${all_ports:|installed_ports})
|
||||||
|
|
||||||
_wanted packages expl 'packages' \
|
|
||||||
compadd "$@" "$disp[@]" - "${(@)pkgs%%:*}"
|
|
||||||
|
|
||||||
|
_describe 'notinstalledports' not_installed_ports
|
||||||
}
|
}
|
||||||
|
|
||||||
_listlocked() {
|
_lockedports() {
|
||||||
local liste expl pkgs installed
|
local -a list
|
||||||
local -a disp
|
list=(${(f)"$(prt-cache listlocked 2>/dev/null)"})
|
||||||
|
_describe 'lockedports' list
|
||||||
pkgs=($(prt-cache listlocked))
|
|
||||||
|
|
||||||
_wanted packages expl 'packages' \
|
|
||||||
compadd "$@" "$disp[@]" - "${(@)pkgs%%:*}"
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_listupdates() {
|
_unlockedports() {
|
||||||
local liste expl pkgs installed
|
local -a installed locked list
|
||||||
local -a disp
|
installed=("${(f)$(prt-cache listinst)}")
|
||||||
|
locked=("${(f)$(prt-cache listlocked)}")
|
||||||
pkgs=($(prt-cache quickdiff))
|
list=("${(f)$(echo ${installed[@]} ${locked[@]} | tr ' ' '\n' | sort | uniq -u)}")
|
||||||
|
_describe 'unlockedports' list
|
||||||
_wanted packages expl 'packages' \
|
|
||||||
compadd "$@" "$disp[@]" - "${(@)pkgs%%:*}"
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_outdatedports() {
|
||||||
|
local -a list
|
||||||
|
list=(${(f)"$(prt-cache quickdiff | tr ' ' '\n' | sort)"})
|
||||||
|
_describe 'outdatedports' list
|
||||||
|
}
|
||||||
|
|
||||||
if (( CURRENT == 2 )); then
|
# TODO: print files from <port> that exist inside the directory
|
||||||
_describe 'prt-get command' '(
|
# valid file for cat and edit
|
||||||
install:install\ package
|
_validfiles() {
|
||||||
depinst:install\ package\ including\ its\ dependencies
|
local -a list
|
||||||
grpinst:install\ given\ packages\ but\ stop\ if\ installation\ of\ a\ package\ fails
|
list=(
|
||||||
update:update\ package
|
"Pkgfile"
|
||||||
remove:remove\ package
|
".signature"
|
||||||
sysup:update\ all\ installed\ packages\ which\ are\ outdated
|
".footprint"
|
||||||
lock:do\ not\ take\ into\ account\ these\ packages\ in\ sysup\ operation
|
"README"
|
||||||
unlock:remove\ lock\ from\ package
|
"README.md"
|
||||||
listlocked:list\ all\ locked\ packages
|
)
|
||||||
diff:show\ differences\ between\ installed\ packages\ and\ ports\ in\ the\ ports\ tree
|
_describe 'validfiles' list
|
||||||
quickdiff:print\ a\ simple\ list\ of\ packages\ whose\ versions\ differ\ from\ those\ in\ the\ ports\ tree
|
}
|
||||||
search:search\ ports\ tree\ for\ packages\ matching
|
|
||||||
dsearch:search\ ports\ tree\ for\ package\ name\ or\ description
|
|
||||||
fsearch:search\ for\ files\ in\ packages\ footprint
|
|
||||||
info:display\ information\ about\ a\ port
|
|
||||||
path:print\ path\ of\ a\ port
|
|
||||||
readme:print\ a\ ports\ readme
|
|
||||||
depends:print\ a\ recursive\ list\ of\ ports\ that\ are\ required\ by\ the\ given\ ports
|
|
||||||
quickdep:print\ a\ simple\ list\ of\ recursive\ dependencies\ of\ the\ given\ ports
|
|
||||||
dependent:print\ a\ list\ of\ ports\ depending\ on\ the\ given\ port
|
|
||||||
deptree:print\ a\ tree\ of\ dependencies\ of\ the\ given\ package
|
|
||||||
dup:list\ ports\ that\ can\ be\ found\ in\ multiple\ port\ directories
|
|
||||||
list:list\ ports\ available\ in\ the\ ports\ tree
|
|
||||||
printf:print\ formated\ port\ list
|
|
||||||
listinst:list\ installed\ ports
|
|
||||||
listorphans:list\ installed\ ports\ which\ have\ no\ no\ dependent\ packages
|
|
||||||
isinst:check\ wether\ a\ given\ package\ is\ installed
|
|
||||||
current:print\ version\ of\ an\ installed\ package
|
|
||||||
ls:print\ the\ the\ files\ of\ a\ package\ directory
|
|
||||||
cat:print\ the\ content\ of\ a\ file\ in\ a\ ports\ directory
|
|
||||||
edit:edit\ a\ packages\ file
|
|
||||||
help:show\ available\ options
|
|
||||||
dumpconfig:dump\ the\ current\ configuration
|
|
||||||
cache:create\ the\ cache\ file\ for\ prt-cache
|
|
||||||
version:show\ the\ current\ version\ of\ prt-get
|
|
||||||
)' && ret=0
|
|
||||||
|
|
||||||
else
|
# Main completion function
|
||||||
shift words
|
_arguments \
|
||||||
(( CURRENT-- ))
|
"${_options[@]}" \
|
||||||
subcmd="$words[1]"
|
":command:->command" \
|
||||||
curcontext="${curcontext%:*}-${subcmd}:"
|
"*::options:->options"
|
||||||
|
|
||||||
if (( CURRENT == 2 )); then
|
# Command completion
|
||||||
case $subcmd in
|
case $state in
|
||||||
remove|lock|current) _listinstalled && ret=0 ;;
|
command)
|
||||||
path|depends|dependent|deptree|isinst|ls|cat|edit) _list && ret=0 ;;
|
_describe 'commands' _commands
|
||||||
unlock) _listlocked && ret=0 ;;
|
;;
|
||||||
install|grpinst|depinst) _list_notinstalled && ret=0 ;;
|
options)
|
||||||
info|readme|search) _list && ret=0 ;;
|
case $words[1] in
|
||||||
update) _listupdates && ret=0 ;;
|
help | version | listorphans)
|
||||||
*) _message 'unknown subcommand: $subcmd' ;;
|
# No options for help | version command
|
||||||
|
;;
|
||||||
|
list)
|
||||||
|
_description list list '<filter>, e.g. *xorg*'
|
||||||
|
;;
|
||||||
|
listinst)
|
||||||
|
# TODO [<filter>]
|
||||||
|
_arguments -C \
|
||||||
|
"${_infooptions[@]}"
|
||||||
|
;;
|
||||||
|
printf)
|
||||||
|
# TODO <format>
|
||||||
|
# TODO [--sort=<format string2>] [--filter=<filter>]
|
||||||
|
local msg=(
|
||||||
|
'format string'
|
||||||
|
'[--sort=format_string2] [--filter=filter_string]'
|
||||||
|
''
|
||||||
|
'Supported format specifiers:'
|
||||||
|
'%n - name'
|
||||||
|
'%p - path'
|
||||||
|
'%v - version'
|
||||||
|
'%r - release'
|
||||||
|
'%d - description'
|
||||||
|
'%e - dependencies'
|
||||||
|
'%u - URL'
|
||||||
|
'%P - Packager'
|
||||||
|
'%M - Maintainer'
|
||||||
|
'%R - Readme (yes/no)'
|
||||||
|
'%E - pre-install script (yes/no)'
|
||||||
|
'%O - post-install script (yes/no)'
|
||||||
|
'%l - is locked (yes/no)'
|
||||||
|
'%i - installed (no/yes/diff)'
|
||||||
|
)
|
||||||
|
;;
|
||||||
|
info | path | readme | ls)
|
||||||
|
_arguments \
|
||||||
|
":port:_allports"
|
||||||
|
;;
|
||||||
|
current)
|
||||||
|
_arguments -S \
|
||||||
|
":installedports:_installedports"
|
||||||
|
;;
|
||||||
|
cat | edit)
|
||||||
|
_arguments -C \
|
||||||
|
":port:_allports" \
|
||||||
|
":validfiles:_validfiles" \
|
||||||
|
;;
|
||||||
|
diff)
|
||||||
|
_arguments -S \
|
||||||
|
"*:outdatedports:_outdatedports" \
|
||||||
|
"${_diffoptions[@]}"
|
||||||
|
;;
|
||||||
|
quickdiff)
|
||||||
|
# No Options for quickdiff
|
||||||
|
;;
|
||||||
|
depends | quickdep | isinst)
|
||||||
|
_arguments -S \
|
||||||
|
":port:_allports" \
|
||||||
|
;;
|
||||||
|
dependent)
|
||||||
|
_arguments \
|
||||||
|
":port:_allports" \
|
||||||
|
"${_depoptions[@]}"
|
||||||
|
;;
|
||||||
|
deptree)
|
||||||
|
_arguments \
|
||||||
|
":port:_allports"
|
||||||
|
;;
|
||||||
|
dup | listlocked)
|
||||||
|
# No arguments for dup and listlocked commands
|
||||||
|
;;
|
||||||
|
search | dsearch)
|
||||||
|
# TODO <expr>
|
||||||
|
;;
|
||||||
|
fsearch)
|
||||||
|
# TODO <pattern>
|
||||||
|
;;
|
||||||
|
update | remove)
|
||||||
|
# TODO: highlight ports that have an update available?
|
||||||
|
# TODO: this completes only outdated once, if available,
|
||||||
|
# then show installedports..
|
||||||
|
_arguments -S \
|
||||||
|
":outdatedports:_outdatedports" \
|
||||||
|
"*:installedports:_installedports" \
|
||||||
|
"${_installoptions[@]}"
|
||||||
|
;;
|
||||||
|
install | grpinst | depinst)
|
||||||
|
_arguments -S \
|
||||||
|
"*:notinstalledports:_notinstalledports" \
|
||||||
|
"${_installoptions[@]}"
|
||||||
|
;;
|
||||||
|
sysup)
|
||||||
|
_arguments -S \
|
||||||
|
"${_sysupoptions[@]}"
|
||||||
|
;;
|
||||||
|
lock)
|
||||||
|
_arguments -S \
|
||||||
|
"*:unlockedports:_unlockedports"
|
||||||
|
;;
|
||||||
|
unlock)
|
||||||
|
_arguments -S \
|
||||||
|
"*:lockedports:_lockedports"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
;;
|
||||||
fi
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return ret
|
|
||||||
|
|
6
zsh/_rejmerge
Normal file
6
zsh/_rejmerge
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
#compdef rejmerge
|
||||||
|
|
||||||
|
_arguments \
|
||||||
|
'(-r --root)'{-r,--root}'[specify alternative root]:root directory:_files -/' \
|
||||||
|
'(-v --version)'{-v,--version}'[print version and exit]' \
|
||||||
|
'(-h --help)'{-h,--help}'[print help and exit]'
|
|
@ -1,13 +1,13 @@
|
||||||
'\" t
|
'\" t
|
||||||
.\" Title: zsh-lovers
|
.\" Title: zsh-lovers
|
||||||
.\" Author: [see the "AUTHORS" section]
|
.\" Author: [see the "AUTHORS" section]
|
||||||
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
|
.\" Generator: DocBook XSL-NS Stylesheets vsnapshot <http://docbook.sf.net/>
|
||||||
.\" Date: 04/03/2014
|
.\" Date: 02/28/2023
|
||||||
.\" Manual: \ \&
|
.\" Manual: \ \&
|
||||||
.\" Source: \ \&
|
.\" Source: \ \&
|
||||||
.\" Language: English
|
.\" Language: English
|
||||||
.\"
|
.\"
|
||||||
.TH "ZSH\-LOVERS" "1" "04/03/2014" "\ \&" "\ \&"
|
.TH "ZSH\-LOVERS" "1" "02/28/2023" "\ \&" "\ \&"
|
||||||
.\" -----------------------------------------------------------------
|
.\" -----------------------------------------------------------------
|
||||||
.\" * Define some portability stuff
|
.\" * Define some portability stuff
|
||||||
.\" -----------------------------------------------------------------
|
.\" -----------------------------------------------------------------
|
||||||
|
@ -34,14 +34,14 @@ zsh-lovers \- tips, tricks and examples for the Z shell
|
||||||
Just read it\&. ;\-)
|
Just read it\&. ;\-)
|
||||||
.SH "OVERVIEW"
|
.SH "OVERVIEW"
|
||||||
.sp
|
.sp
|
||||||
Whenever we look at the zsh manual we wonder why there are no examples or those simply things in (shell) life\&. The zsh contains many features, but there was no manpage with some examples (like procmailex(5))\&. That\(cqs why we wrote this manpage\&.
|
Whenever we look at the zsh manual we wonder why there are no examples or those simple things in (shell) life\&. The zsh contains many features, but there was no manpage with some examples (like procmailex(5))\&. That\(cqs why we wrote this manpage\&.
|
||||||
.sp
|
.sp
|
||||||
Most of the tricks and oneliner come from the mailinglists zsh\-users, zsh\-workers, google, newsgroups and from ourself\&. See section \fBLINKS\fR for details\&.
|
Most of the tricks and oneliners come from the mailing lists zsh\-users, zsh\-workers, google, newsgroups and from ourselves\&. See section \fBLINKS\fR for details\&.
|
||||||
.sp
|
.sp
|
||||||
Note: This manpage (zsh\-lovers(1)) is \fBnot\fR an offical part of the Z shell! It\(cqs just a just for fun \- manpage ;) For comments, bugreports and feedback take a quick look at the section \fBBUGS\fR\&.
|
Note: This manpage (zsh\-lovers(1)) is \fBnot\fR an official part of the Z shell! It\(cqs just a just for fun \- manpage ;) For comments, bugreports and feedback take a quick look at the section \fBBUGS\fR\&.
|
||||||
.SH "SHELL-SCRIPTING"
|
.SH "SHELL\-SCRIPTING"
|
||||||
.sp
|
.sp
|
||||||
This section provides some examples for often needed shellscript\-stuff\&. Notice that you should not use otherwise most examples won\(cqt work\&. Parse options in shellscripts\&. Example taken from ZWS by Adam Chodorowski (http://www\&.chodorowski\&.com/projects/zws/):
|
This section provides some examples for often needed shellscript\-stuff\&. \fBNote:\fR You should not use this otherwise most examples won\(cqt work\&. Parse options in shellscripts\&. Example taken from ZWS by Adam Chodorowski (http://www\&.chodorowski\&.com/projects/zws/):
|
||||||
.sp
|
.sp
|
||||||
.if n \{\
|
.if n \{\
|
||||||
.RS 4
|
.RS 4
|
||||||
|
@ -90,7 +90,7 @@ alias \-s org=w3m
|
||||||
.RE
|
.RE
|
||||||
.\}
|
.\}
|
||||||
.sp
|
.sp
|
||||||
Now pressing return\-key after entering \fIfoobar\&.tex\fR starts vim with foobar\&.tex\&. Calling a html\-file runs browser w3m\&. \fIwww\&.zsh\&.org\fR and pressing enter starts w3m with argument www\&.zsh\&.org\&. Global aliases can be used anywhere in the command line\&. Example:
|
Now pressing the return\-key after entering \fIfoobar\&.tex\fR starts vim with foobar\&.tex\&. Calling an html\-file runs browser w3m\&. \fIwww\&.zsh\&.org\fR and pressing enter starts w3m with argument www\&.zsh\&.org\&. Global aliases can be used anywhere in the command line\&. Example:
|
||||||
.sp
|
.sp
|
||||||
.if n \{\
|
.if n \{\
|
||||||
.RS 4
|
.RS 4
|
||||||
|
@ -260,7 +260,7 @@ zstyle \*(Aq:completion:*:kill:*\*(Aq force\-list always
|
||||||
.RE
|
.RE
|
||||||
.\}
|
.\}
|
||||||
.sp
|
.sp
|
||||||
If you end up using a directory as argument, this will remove the trailing slash (usefull in ln)
|
If you end up using a directory as argument, this will remove the trailing slash (useful in ln)
|
||||||
.sp
|
.sp
|
||||||
.if n \{\
|
.if n \{\
|
||||||
.RS 4
|
.RS 4
|
||||||
|
@ -351,7 +351,7 @@ Hint: A list of valid glob Qualifiers can be found in zshexpn(1)\&. See \(lqman
|
||||||
# All files for which the owner hat read and execute permissions
|
# All files for which the owner hat read and execute permissions
|
||||||
$ echo *(f:u+rx:)
|
$ echo *(f:u+rx:)
|
||||||
|
|
||||||
# The same, but also others dont have execute permissions
|
# The same, but also others don\*(Aqt have execute permissions
|
||||||
$ echo *(f:u+rx,o\-x:)
|
$ echo *(f:u+rx,o\-x:)
|
||||||
|
|
||||||
# brace expansion \- example
|
# brace expansion \- example
|
||||||
|
@ -380,7 +380,7 @@ Hint: A list of valid glob Qualifiers can be found in zshexpn(1)\&. See \(lqman
|
||||||
# Remove zero length and \&.bak files in a directory
|
# Remove zero length and \&.bak files in a directory
|
||||||
$ rm \-i *(\&.L0) *\&.bak(\&.)
|
$ rm \-i *(\&.L0) *\&.bak(\&.)
|
||||||
|
|
||||||
# print out files that dont have extensions
|
# print out files that don\*(Aqt have extensions
|
||||||
$ printf \*(Aq%s\en\*(Aq ^?*\&.*
|
$ printf \*(Aq%s\en\*(Aq ^?*\&.*
|
||||||
$ printf \*(Aq%s\en\*(Aq ^?*\&.[^\&.]*(D)
|
$ printf \*(Aq%s\en\*(Aq ^?*\&.[^\&.]*(D)
|
||||||
$ ls \-d \-\- ^?*\&.*(D)
|
$ ls \-d \-\- ^?*\&.*(D)
|
||||||
|
@ -448,7 +448,7 @@ Hint: A list of valid glob Qualifiers can be found in zshexpn(1)\&. See \(lqman
|
||||||
# see above, but now omit executables
|
# see above, but now omit executables
|
||||||
$ ls **/*~*(${~${(j/|/)fignore}})(\&.^*)
|
$ ls **/*~*(${~${(j/|/)fignore}})(\&.^*)
|
||||||
|
|
||||||
# Print out files that dont have extensions (require *setopt extendedglob*
|
# Print out files that don\*(Aqt have extensions (require *setopt extendedglob*
|
||||||
# and *setopt dotglob*)
|
# and *setopt dotglob*)
|
||||||
$ printf \*(Aq%s\en\*(Aq ^?*\&.*
|
$ printf \*(Aq%s\en\*(Aq ^?*\&.*
|
||||||
|
|
||||||
|
@ -905,7 +905,7 @@ Modifiers are a powerful mechanism that let you modify the results returned by p
|
||||||
.\}
|
.\}
|
||||||
.SS "Redirection\-Examples"
|
.SS "Redirection\-Examples"
|
||||||
.sp
|
.sp
|
||||||
See zshmisc(1) for more informations (or less ${^fpath}/zmv(N))
|
See zshmisc(1) for more information (or less ${^fpath}/zmv(N))
|
||||||
.sp
|
.sp
|
||||||
.if n \{\
|
.if n \{\
|
||||||
.RS 4
|
.RS 4
|
||||||
|
@ -993,7 +993,7 @@ See zshmisc(1) for more informations (or less ${^fpath}/zmv(N))
|
||||||
$ ls *
|
$ ls *
|
||||||
1\&.c 1\&.foo 2\&.foo 3\&.foo 4\&.foo foo\&.fnord
|
1\&.c 1\&.foo 2\&.foo 3\&.foo 4\&.foo foo\&.fnord
|
||||||
|
|
||||||
# Rename "file\&.with\&.many\&.dots\&.txt" by substituting dots (exept for the last
|
# Rename "file\&.with\&.many\&.dots\&.txt" by substituting dots (except for the last
|
||||||
# one!) with a space
|
# one!) with a space
|
||||||
$ touch {1\&.\&.20}\-file\&.with\&.many\&.dots\&.txt
|
$ touch {1\&.\&.20}\-file\&.with\&.many\&.dots\&.txt
|
||||||
$ zmv \*(Aq(*\&.*)(\&.*)\*(Aq \*(Aq${1//\&./ }$2\*(Aq
|
$ zmv \*(Aq(*\&.*)(\&.*)\*(Aq \*(Aq${1//\&./ }$2\*(Aq
|
||||||
|
@ -1373,7 +1373,7 @@ Please read zshmodules(1) first!
|
||||||
|
|
||||||
# If a XML\-file contains stuff like ``<TAGA/>\*(Aq\*(Aq and ``<TAGB/>\*(Aq\*(Aq, number
|
# If a XML\-file contains stuff like ``<TAGA/>\*(Aq\*(Aq and ``<TAGB/>\*(Aq\*(Aq, number
|
||||||
# this empty tags (ones ending in \*(Aq/>\*(Aq) so if encountered in the same
|
# this empty tags (ones ending in \*(Aq/>\*(Aq) so if encountered in the same
|
||||||
# order, the preceeding tags would become ``<TAGA/>1</TAGA>\*(Aq\*(Aq and
|
# order, the preceding tags would become ``<TAGA/>1</TAGA>\*(Aq\*(Aq and
|
||||||
# ``<TAGB/>2</TAGB>\*(Aq\*(Aq
|
# ``<TAGB/>2</TAGB>\*(Aq\*(Aq
|
||||||
$ zmodload zsh/mapfile
|
$ zmodload zsh/mapfile
|
||||||
$ cnt=0
|
$ cnt=0
|
||||||
|
@ -1831,7 +1831,7 @@ ZSH Prompt introduction
|
||||||
.PP
|
.PP
|
||||||
ft\(cqs zsh configuration
|
ft\(cqs zsh configuration
|
||||||
.RS 4
|
.RS 4
|
||||||
\fBhttp://ft\&.bewatermyfriend\&.org/comp/zsh\&.html\fR
|
\fBhttp://ft\&.bewatermyfriend\&.org/computer/zsh\&.html\fR
|
||||||
.RE
|
.RE
|
||||||
.PP
|
.PP
|
||||||
Adam\(cqs ZSH page
|
Adam\(cqs ZSH page
|
||||||
|
@ -1875,14 +1875,14 @@ In alphabetic order:
|
||||||
.nf
|
.nf
|
||||||
Andrew \*(Aqzefram\*(Aq Main \- http://www\&.fysh\&.org/~zefram/
|
Andrew \*(Aqzefram\*(Aq Main \- http://www\&.fysh\&.org/~zefram/
|
||||||
Barton E\&. Schaefer \- http://www\&.well\&.com/user/barts/
|
Barton E\&. Schaefer \- http://www\&.well\&.com/user/barts/
|
||||||
Matthias Kopfermann \- http://www\&.infodrom\&.north\&.de/~matthi/
|
Matthias Kopfermann \- http://www\&.guckes\&.net/zsh/lover\&.html
|
||||||
Oliver Kiddle \- http://people\&.freenet\&.de/opk/
|
Oliver Kiddle \- http://people\&.freenet\&.de/opk/
|
||||||
Paul Falstad \- http://www\&.falstad\&.com/
|
Paul Falstad \- http://www\&.falstad\&.com/
|
||||||
Peter Stephenson \- http://homepage\&.ntlworld\&.com/p\&.w\&.stephenson/
|
Peter Stephenson \- http://homepage\&.ntlworld\&.com/p\&.w\&.stephenson/
|
||||||
Richard Coleman
|
Richard Coleman
|
||||||
Stephane Chazelas \- http://stephane\&.chazelas\&.free\&.fr/
|
Stephane Chazelas \- http://stephane\&.chazelas\&.free\&.fr/
|
||||||
Sven Guckes \- http://www\&.guckes\&.net/
|
Sven Guckes \- http://www\&.guckes\&.net/
|
||||||
Sven Wischnowsky \- http://w9y\&.de/zsh/zshrc
|
Sven Wischnowsky \- http://w9y\&.de/
|
||||||
.fi
|
.fi
|
||||||
.if n \{\
|
.if n \{\
|
||||||
.RE
|
.RE
|
||||||
|
|
Loading…
Reference in New Issue
Block a user