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

Autoload vs regular function



Hello,
I tried to do the following on my series of autoload functions (their
names begins with "n-" prefix):

#!/bin/zsh

local PLUGIN_FILE="znt.plugin.zsh"
rm -f "$PLUGIN_FILE"

for i in n-*; do
    echo "$i() {" >>"$PLUGIN_FILE"
    cat "$i" >>"$PLUGIN_FILE"
    echo "}" >>"$PLUGIN_FILE"
    echo >>"$PLUGIN_FILE"
done

to have plugin for the various current frameworks. In result the code
gives file with series of functions. The technique seems to work, but
are there any pitfalls about functions declared in this way instead of
using autoload and separate files? Is this enough to have plugin for
e.g. antigen?

Best regards,
Sebastian Gniazdowski



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