Autoload : function on startup.

The newly added `:` command is implemented as a function (to avoid
increasing complexity by making it a builtin), but it is saved to a path
that does not match its filename (since its name is somewhat of a
special character that might cause problems during installation).
Directly probing the `colon` function for autoload causes `:` to be
correctly loaded, so doing just that after function paths are loaded
upon startup.

This is a hack since the CPP code shouldn't really be aware of
individual functions, perhaps there is a better way of doing this.
This commit is contained in:
Mahmoud Al-Qudsi
2018-03-14 18:22:10 -05:00
parent 007ae0b15e
commit 3996e437b6
5 changed files with 17 additions and 4 deletions

View File

@@ -384,6 +384,9 @@ int main(int argc, char **argv) {
const io_chain_t empty_ios;
if (read_init(paths)) {
// Additional initialization that must occur after paths are loaded
misc_init_with_paths();
// Stomp the exit status of any initialization commands (issue #635).
proc_set_last_status(STATUS_CMD_OK);