Signed-off-by: Frank Terbeck <ft@bewatermyfriend.org>
Creates an alias whith sudo prepended, if $EUID is not zero. Run "salias -h"
for details. See also xunfunction() below.
-: **show-archive()**
-Lists the contents of a (compressed) archive with the appropriate programs.
-The choice is made along the filename extension.
-
: **simple-extract()**
Tries to uncompress/unpack given files with the appropriate programs. If an URI
starting with https, http or ftp is provided simple-extract tries to download
compdef _simple_extract simple-extract
alias se=simple-extract
-# Usage: show-archive <archive>
-#f5# List an archive's content
-show-archive() {
- emulate -L zsh
- if [[ -f $1 ]] ; then
- case $1 in
- *.tar.gz) gunzip -c $1 | tar -tf - -- ;;
- *.tar) tar -tf $1 ;;
- *.tgz) tar -ztf $1 ;;
- *.zip) unzip -l $1 ;;
- *.bz2) bzless $1 ;;
- *.deb) dpkg-deb --fsys-tarfile $1 | tar -tf - -- ;;
- *) echo "'$1' Error. Please go away" ;;
- esac
- else
- echo "'$1' is not a valid archive"
- fi
-}
-
# TODO: So, this is the third incarnation of this function!?
#f5# Reload given functions
refunc() {