Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

mtools handling



Hi,

a complain I've heard about zsh is that

mcopy a:* .

doesn't work like in bash, because zsh doesn't just give unmatched
globs to the programs (which is a GOOD thing). With this little code,
it works also in zsh, and you get a nifty tab completion, too :)
Perhaps it could be added to the examples section.

	Falk


my-mcopy () {
    mcopy `mtools-glob "$@"`
}

mtools-glob () {
  for i in "$@"; do
    case "$i" in
      [aAbB]:*)
        echo -n "$i "
        ;;
      *)
	echo -n "`eval echo $i` "
	;;
    esac
  done
  echo	      
}
alias mdir='noglob mdir'      # no glob expansion on mdir a:*
alias mdel='noglob mdel'
alias mcopy='noglob my-mcopy'

compctl -f -x 's[a:]' -s '`echo ${$(mdir -X)##*/}`' -- mdel mtype my-mcopy mcd mdeltree mdir mrd mren




Messages sorted by: Reverse Date, Date, Thread, Author