diff options
author | James Booth <boothj5@gmail.com> | 2017-02-05 19:16:14 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2017-02-05 19:16:14 +0000 |
commit | dd42c3de6af29f1a59aa890ee0dae92f71efa23b (patch) | |
tree | d0f0a5fd32fe81569382344f5d4d14b3b50ff28e /src/command/cmd_funcs.c | |
parent | a9fab9ed2dc75671e61a6d44ba0ea5c861eeb5dc (diff) | |
download | profani-tty-dd42c3de6af29f1a59aa890ee0dae92f71efa23b.tar.gz |
Allow loading all plugins
Diffstat (limited to 'src/command/cmd_funcs.c')
-rw-r--r-- | src/command/cmd_funcs.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index 6f238612..7f854249 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -6264,9 +6264,21 @@ gboolean cmd_plugins_load(ProfWin *window, const char *const command, gchar **args) { if (args[1] == NULL) { - cons_bad_cmd_usage(command); + GSList *loaded = plugins_load_all(); + if (loaded) { + cons_show("Loaded plugins:"); + GSList *curr = loaded; + while (curr) { + cons_show(" %s", curr->data); + curr = g_slist_next(curr); + } + g_slist_free_full(loaded, g_free); + } else { + cons_show("No plugins loaded."); + } return TRUE; } + gboolean res = plugins_load(args[1]); if (res) { cons_show("Loaded plugin: %s", args[1]); @@ -6281,8 +6293,12 @@ gboolean cmd_plugins_unload(ProfWin *window, const char *const command, gchar **args) { if (args[1] == NULL) { - plugins_unload_all(); - cons_show("Unloaded all plugins"); + gboolean res = plugins_unload_all(); + if (res) { + cons_show("Unloaded all plugins."); + } else { + cons_show("No plugins unloaded."); + } return TRUE; } |