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

zrecompile -p -R/-M has no effect



I noticed a while ago that my .zshrc.zwc stayed mapped forever, so I
tried to give -R to the zrecompile invocation that handles my init
files, but

% zcompile() { >&2 echo -E - zcompile "$@"; builtin zcompile "$@" }
% touch .zshrc; zrecompile -p -R .zshrc
zcompile -t .zshrc.zwc
re-compiling .zshrc.zwc: zcompile .zshrc.zwc .zshrc
succeeded

It ate my -R. If you try to reproduce this locally, note that read is
the default for small files, so try also with -M to see if you can
change it to (mapped) instead of vice versa as here.

% builtin zcompile -t .zshrc.zwc
zwc file (mapped) for zsh-5.1.1-dev-0-mika
.zshrc
% builtin zcompile -R .zshrc
% builtin zcompile -t .zshrc.zwc
zwc file (read) for zsh-5.1.1-dev-0-mika
.zshrc

The example in the manpage even uses this as an example;

If the -p option is given, the args are interpreted  as  one  or  more
sets of arguments for zcompile, separated by `--'.  For example:
  zrecompile -p \
   -R ~/.zshrc -- \
   -M ~/.zcompdump -- \
   ~/zsh/comp.zwc ~/zsh/Completion/*/_*

It looks like there is a getopt thing trying to check for these, but
presumably it doesn't work,

    while getopts :MR opt $files; do
      case $opt in
      [MR]) map=( -$opt ) ;;
      *) tmp=( $tmp $files[OPTIND] );;
      esac
    done
...
    zcompile $map $tmp $zwc $files

I have no idea how getopt works, so if anyone thinks "ah, what an
obvious and easy fix" when seeing this, that would be nice.

-- 
Mikael Magnusson



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