zsh-workers
 help / color / mirror / code / Atom feed
0cdf7e2aac5618c967586e5859bcd7600b32bd32 blob 613 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
# function zftype {
local type zftmp=${TMPPREFIX}zftype$$
[[ $curcontext = :zf* ]] || local curcontext=:zftype

zfautocheck -d

if (( $# == 0 )); then
  zftp type >$zftmp
  type=$(<$zftmp)
  rm -f $zftmp
  if [[ $type = I ]]; then
    print "Current type is image (binary)"
    return 0
  elif [[ $type = A ]]; then
    print "Current type is ASCII"
    return 0
  else
    return 1
  fi
else
  if [[ $1 == (#i)a(sc(ii|)|) ]]; then
    type=A
  elif [[ $1 == (#i)i(m(age|)|) || $1 == (#i)b(in(ary|)|) ]]; then
    type=I
  else
    print "Type not recognised:  $1" 2>&1
    return 1
  fi
  zftp type $type
fi
# }
debug log:

solving 0cdf7e2 ...
found 0cdf7e2 in https://git.vuxu.org/mirror/zsh/

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).