ports/opt (3.7): zsh: overhauled shell completion for prt-get, added rest of pkgutils, updated zsh-lovers.1
commit c5e1709c362acb733c7f7db72f5497495e054d92 Author: Tim Biermann <tbier@posteo.de> Date: Tue Feb 28 18:08:36 2023 +0100 zsh: overhauled shell completion for prt-get, added rest of pkgutils, updated zsh-lovers.1 diff --git a/zsh/.footprint b/zsh/.footprint index 22656d877..ddb8b63dd 100644 --- a/zsh/.footprint +++ b/zsh/.footprint @@ -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/ -rw-r--r-- root/root usr/share/zsh/5.9/scripts/newuser 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/_rejmerge diff --git a/zsh/.signature b/zsh/.signature index da24419cb..68e04d3e8 100644 --- a/zsh/.signature +++ b/zsh/.signature @@ -1,7 +1,12 @@ untrusted comment: verify with /etc/ports/opt.pub -RWSE3ohX2g5d/ZfhkJ+2R4QmpFyCgNVVczdY3WkgjBgLGy6ALYnyAaNHgfTBEaoir5sVZMj4Rq5erIz5doi0q/A3aiu5ExgdVg4= -SHA256 (Pkgfile) = 3c8cd5af47066fe2e601be31180d7abd68d01d802aa6891beb24b1b55c8ddc59 -SHA256 (.footprint) = e6b46e0a1ae2ab41c0d350db30e9195d0402cb369139bc0d97daefb8007d8868 +RWSE3ohX2g5d/S9Tqrkxft/1NSk5QWMI1tIiAEcdbFu8+ahnWth653mt0fOtupguGgIf554AtBdtdZyLeNESfsBFhEaI/nkJvAA= +SHA256 (Pkgfile) = 290c58811adfa5c2670b2680e4c7d97900e5e673bcb50a79781dbee10aaae65f +SHA256 (.footprint) = f4bf0634a73205ac5c1ae0739ef230cbbf6867bd012755e13da4ed8da30a838b SHA256 (zsh-5.9.tar.xz) = 9b8d1ecedd5b5e81fbf1918e876752a7dd948e05c1a0dba10ab863842d45acd5 -SHA256 (_prt-get) = de2e23df932f0c855c0e34389cc8a3d1083b30114f437cb77cb19df2a261b21c -SHA256 (zsh-lovers.1) = b40802dd83f1f2eded9823776ae90af8e0b91488e97f98b3a0629f8d11953e81 +SHA256 (_prt-get) = a0ffcbe04f9a217543e8923b20c676bf8ea6864dbc4037a3e1afe41e0b33ff91 +SHA256 (_pkgadd) = 2d1e07012c72e6eeabdb4298e985ed27b8eebd25030f4f3703ae1c344ab5eeec +SHA256 (_pkgmk) = 1499c43d5092d98dfa3ed07be6388735ed4f0e43608e26eedd3cf95494c5801d +SHA256 (_pkginfo) = 90d7e38e0982271133d5a9a6ff436830e6c7669c4d3b47bcca49e33bfbdd9f7f +SHA256 (_pkgrm) = cdd2bc5097cfc5c57592b677dee39f5ff4ae065e04997fa628367977068d4458 +SHA256 (_rejmerge) = d9060208a9f26c88bfe96f734cdbd461252dcbc413782c947a3a2a0e25e82d38 +SHA256 (zsh-lovers.1) = c13688b37897c98d2593826b0ab7606927a28998d73ff0c8a2a4d07dad93944a diff --git a/zsh/Pkgfile b/zsh/Pkgfile index 373a48924..2290fd79c 100644 --- a/zsh/Pkgfile +++ b/zsh/Pkgfile @@ -5,9 +5,10 @@ name=zsh version=5.9 -release=1 +release=2 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() { 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/misc/usb.ids#/usr/share/usb.ids#g' Completion/Linux/Command/_lsusb - # fix a bug in recent glibc versions (2.16) - 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 + sed -e 's|^\.NOTPARALLEL|#.NOTPARALLEL|' -i 'Config/defs.mk.in' for _fpath in AIX Cygwin Darwin Debian Mandriva openSUSE Redhat Solaris; do rm -rf Completion/$_fpath @@ -28,6 +26,8 @@ build() { rm -f Completion/Linux/Command/_{pkgtool,rpmbuild,yast} rm -f Completion/Unix/Command/_{osc,systemd} + rm Doc/version.yo + ./configure \ --prefix=/usr \ --sysconfdir=/etc \ @@ -49,7 +49,9 @@ build() { --enable-multibyte \ --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 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} 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 } diff --git a/zsh/_pkgadd b/zsh/_pkgadd new file mode 100644 index 000000000..31687e346 --- /dev/null +++ b/zsh/_pkgadd @@ -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' diff --git a/zsh/_pkginfo b/zsh/_pkginfo new file mode 100644 index 000000000..a81ff39d2 --- /dev/null +++ b/zsh/_pkginfo @@ -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]' diff --git a/zsh/_pkgmk b/zsh/_pkgmk new file mode 100644 index 000000000..1284c9587 --- /dev/null +++ b/zsh/_pkgmk @@ -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]' diff --git a/zsh/_pkgrm b/zsh/_pkgrm new file mode 100644 index 000000000..fb593c4f6 --- /dev/null +++ b/zsh/_pkgrm @@ -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' diff --git a/zsh/_prt-get b/zsh/_prt-get index 7691af757..9d66dd6a7 100644 --- a/zsh/_prt-get +++ b/zsh/_prt-get @@ -1,123 +1,297 @@ #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() { - local liste expl pkgs - local -a disp +# Options Information +_infooptions=( + "--depsort[Sort by dependencies]" +) - installed=($(prt-cache listinst)) - pkgs=($(prt-cache list)) - pkgs=(${pkgs:#${(j:|:)~${installed:q}}}) +# Options for Differences / Check for updates +_diffoptions=( + "--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' \ - compadd "$@" "$disp[@]" - "${(@)pkgs%%:*}" +# Options for Dependencies +_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]" +) -_list() { - local liste expl pkgs installed - local -a disp +# 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]" +) - pkgs=($(prt-cache list)) +_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]' +) - _wanted packages expl 'packages' \ - compadd "$@" "$disp[@]" - "${(@)pkgs%%:*}" +# 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 } -_listinstalled() { - local liste expl pkgs installed - local -a disp - - pkgs=($(prt-cache listinst)) - - _wanted packages expl 'packages' \ - compadd "$@" "$disp[@]" - "${(@)pkgs%%:*}" - +_installedports() { + local -a list + list=(${(f)"$(prt-get listinst 2>/dev/null)"}) + _describe 'installedports' list } -_listlocked() { - local liste expl pkgs installed - local -a disp - - pkgs=($(prt-cache listlocked)) - - _wanted packages expl 'packages' \ - compadd "$@" "$disp[@]" - "${(@)pkgs%%:*}" +_notinstalledports() { + local -a installed_ports all_ports not_installed_ports + installed_ports=(${(f)"$(prt-cache listinst 2>/dev/null)"}) + all_ports=(${(f)"$(prt-cache list 2>/dev/null)"}) + not_installed_ports=(${all_ports:|installed_ports}) + _describe 'notinstalledports' not_installed_ports } -_listupdates() { - local liste expl pkgs installed - local -a disp +_lockedports() { + local -a list + list=(${(f)"$(prt-cache listlocked 2>/dev/null)"}) + _describe 'lockedports' list +} - pkgs=($(prt-cache quickdiff)) +_unlockedports() { + local -a installed locked list + installed=("${(f)$(prt-cache listinst)}") + locked=("${(f)$(prt-cache listlocked)}") + 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 +} +# TODO: print files from <port> that exist inside the directory +# valid file for cat and edit +_validfiles() { + local -a list + list=( + "Pkgfile" + ".signature" + ".footprint" + "README" + "README.md" + ) + _describe 'validfiles' list } +# Main completion function +_arguments \ + "${_options[@]}" \ + ":command:->command" \ + "*::options:->options" -if (( CURRENT == 2 )); then - _describe 'prt-get command' '( - install:install\ package - depinst:install\ package\ including\ its\ dependencies - grpinst:install\ given\ packages\ but\ stop\ if\ installation\ of\ a\ package\ fails - update:update\ package - remove:remove\ package - sysup:update\ all\ installed\ packages\ which\ are\ outdated - lock:do\ not\ take\ into\ account\ these\ packages\ in\ sysup\ operation - unlock:remove\ lock\ from\ package - listlocked:list\ all\ locked\ packages - diff:show\ differences\ between\ installed\ packages\ and\ ports\ in\ the\ ports\ tree - 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 - shift words - (( CURRENT-- )) - subcmd="$words[1]" - curcontext="${curcontext%:*}-${subcmd}:" - - if (( CURRENT == 2 )); then - case $subcmd in - remove|lock|current) _listinstalled && ret=0 ;; - path|depends|dependent|deptree|isinst|ls|cat|edit) _list && ret=0 ;; - unlock) _listlocked && ret=0 ;; - install|grpinst|depinst) _list_notinstalled && ret=0 ;; - info|readme|search) _list && ret=0 ;; - update) _listupdates && ret=0 ;; - *) _message 'unknown subcommand: $subcmd' ;; +# Command completion +case $state in + command) + _describe 'commands' _commands + ;; + options) + case $words[1] in + help | version | listorphans) + # 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 - fi -fi - - - -return ret + ;; +esac diff --git a/zsh/_rejmerge b/zsh/_rejmerge new file mode 100644 index 000000000..1f6e8a178 --- /dev/null +++ b/zsh/_rejmerge @@ -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]' diff --git a/zsh/zsh-lovers.1 b/zsh/zsh-lovers.1 index 2873aa654..b8e37c91f 100644 --- a/zsh/zsh-lovers.1 +++ b/zsh/zsh-lovers.1 @@ -1,13 +1,13 @@ '\" t .\" Title: zsh-lovers .\" Author: [see the "AUTHORS" section] -.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 04/03/2014 +.\" Generator: DocBook XSL-NS Stylesheets vsnapshot <http://docbook.sf.net/> +.\" Date: 02/28/2023 .\" Manual: \ \& .\" Source: \ \& .\" Language: English .\" -.TH "ZSH\-LOVERS" "1" "04/03/2014" "\ \&" "\ \&" +.TH "ZSH\-LOVERS" "1" "02/28/2023" "\ \&" "\ \&" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -34,14 +34,14 @@ zsh-lovers \- tips, tricks and examples for the Z shell Just read it\&. ;\-) .SH "OVERVIEW" .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 -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 -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\&. -.SH "SHELL-SCRIPTING" +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" .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 .if n \{\ .RS 4 @@ -90,7 +90,7 @@ alias \-s org=w3m .RE .\} .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 .if n \{\ .RS 4 @@ -260,7 +260,7 @@ zstyle \*(Aq:completion:*:kill:*\*(Aq force\-list always .RE .\} .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 .if n \{\ .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 $ 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:) # 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 $ 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 ^?*\&.[^\&.]*(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 $ 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*) $ 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" .sp -See zshmisc(1) for more informations (or less ${^fpath}/zmv(N)) +See zshmisc(1) for more information (or less ${^fpath}/zmv(N)) .sp .if n \{\ .RS 4 @@ -993,7 +993,7 @@ See zshmisc(1) for more informations (or less ${^fpath}/zmv(N)) $ ls * 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 $ touch {1\&.\&.20}\-file\&.with\&.many\&.dots\&.txt $ 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 # 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 $ zmodload zsh/mapfile $ cnt=0 @@ -1831,7 +1831,7 @@ ZSH Prompt introduction .PP ft\(cqs zsh configuration .RS 4 -\fBhttp://ft\&.bewatermyfriend\&.org/comp/zsh\&.html\fR +\fBhttp://ft\&.bewatermyfriend\&.org/computer/zsh\&.html\fR .RE .PP Adam\(cqs ZSH page @@ -1875,14 +1875,14 @@ In alphabetic order: .nf Andrew \*(Aqzefram\*(Aq Main \- http://www\&.fysh\&.org/~zefram/ 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/ Paul Falstad \- http://www\&.falstad\&.com/ Peter Stephenson \- http://homepage\&.ntlworld\&.com/p\&.w\&.stephenson/ Richard Coleman Stephane Chazelas \- http://stephane\&.chazelas\&.free\&.fr/ Sven Guckes \- http://www\&.guckes\&.net/ -Sven Wischnowsky \- http://w9y\&.de/zsh/zshrc +Sven Wischnowsky \- http://w9y\&.de/ .fi .if n \{\ .RE
participants (1)
-
crux@crux.nu