Prv8 Shell
Server : Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/1.0.0-fips mod_auth_passthrough/2.1 mod_bwlimited/1.4
System : Linux server.jackjohnson.com 2.6.32-279.5.2.el6.x86_64 #1 SMP Fri Aug 24 01:07:11 UTC 2012 x86_64
User : jackjohn ( 502)
PHP Version : 5.3.17
Disable Function : NONE
Directory :  /usr/share/zsh/4.3.10/functions/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/share/zsh/4.3.10/functions/_list_files
#autoload

# Helper function for _path_files to handle the file-list style.

# arguments:
#  name of parameter containing file matches
#  directory prefix
# Sets array listfiles to the display strings and the array
# listopts appropriately to be added to the compadd command line.

local stat f elt what dir
local -a stylevals
integer ok

listfiles=()
listopts=()

zstyle -a ":completion:${curcontext}:" file-list stylevals || return 1

# TODO: more flexible way of handling the following?  e.g. use $compstate?
case $WIDGETSTYLE in
  (*complete*)
  what=insert
  ;;

  (*)
  what=list
  ;;
esac

for elt in $stylevals; do
  case $elt in
    (*($what|all|true|1|yes)*=<->)
    # use long format if no more than the given number of matches
    (( ${(P)#1} <= ${elt##*=} )) && (( ok = 1 ))
    break
    ;;

    (*($what|all|true|1|yes)[^=]#)
    # always use long format
    (( ok = 1 ))
    break
    ;;
  esac
done

(( ok )) || return 1

zmodload -F zsh/stat b:zstat 2>/dev/null || return 1

dir=${2:+$2/}
dir=${(Q)dir}

for f in ${(PQ)1}; do
  if [[ ! -e "$dir$f" ]]; then
    listfiles+=("$dir$f")
    continue
  fi

  # Borrowed from Functions/Example/zls
  zstat -s -H stat -F "%b %e %H:%M" - "$dir$f" >/dev/null 2>&1

  listfiles+=("$stat[mode] ${(l:3:)stat[nlink]} ${(r:8:)stat[uid]} \
 ${(r:8:)stat[gid]} ${(l:8:)stat[size]} $stat[mtime] $f")
done

(( ${#listfiles} )) && listopts=(-d listfiles -l -o)

return 0

haha - 2025