diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 1999-08-12 22:59:04 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 1999-08-12 22:59:04 +0000 |
commit | 8d1b4b1358db02d6c9426e4bb3553583e11bf112 (patch) | |
tree | a3095364536d55f8356ac99559e440cc91f33eb1 /Functions/zless | |
parent | 5714953c514a5fea35dcd819caf1afef4d92a13b (diff) | |
download | zsh-8d1b4b1358db02d6c9426e4bb3553583e11bf112.tar.gz zsh-8d1b4b1358db02d6c9426e4bb3553583e11bf112.tar.xz zsh-8d1b4b1358db02d6c9426e4bb3553583e11bf112.zip |
Sync up with zsh-3_1_6-pws-1.
Diffstat (limited to 'Functions/zless')
-rw-r--r-- | Functions/zless | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/Functions/zless b/Functions/zless deleted file mode 100644 index 809ce35c7..000000000 --- a/Functions/zless +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/zsh -f -# -# zsh function script to run less on various inputs, decompressing as required. -# Author: Phil Pennock. zsh-hacks@athenaeum.demon.co.uk -# Modified by Bart Schaefer. -# Thanks to zefram@fysh.org for a great deal of help in sorting this out, -# ie wrt syntax for unsetting members of arrays and eval "$(...)" when I -# asked for something better than . =(...) -# -# Use -zforce to pass through a display-formatting command -# zless -zforce 'bzip2 -dc' foo-no-dotbz2 -# zless -zforce 'od -hc' foo-binfile -# -# If you can understand all of this without reference to zshexpn(1) -# and zshparam(1) then you either have a photographic memory or you -# need to get out more. -# - -emulate -R zsh -setopt localoptions - -[[ $# -ge 1 ]] || return -local lessopts -set -A lessopts -integer i=1 loi=1 -while ((i <= $#)) -do - case $argv[i] in - -zforce) argv[i,i+2]=("=($argv[i+1] \"$argv[i+2]\")"); ((++i));; - -*) lessopts[loi++]=\"$argv[i]\"; argv[i]=(); continue;; - *.(gz|Z)) argv[i]="=(zcat \"$argv[i]\")";; - *.bz2) argv[i]="=(bzip2 -dc \"$argv[i]\")";; - *.bz) argv[i]="=(bzip -dc \"$argv[i]\")";; - esac - ((++i)) -done -eval command less $lessopts $* |