/* * An example plug-in, which implements the 'cd' command. */ #include #include #include #include #include #include "../esh.h" #include #include "../esh-sys-utils.h" static bool init_plugin(struct esh_shell *shell) { printf("Plugin 'clean_screen' initialized...\n"); return true; } /* Implement chdir built-in. * Returns true if handled, false otherwise. */ static bool clean_screen_builtin(struct esh_command *cmd) { if (strcmp(cmd->argv[0], "clean_screen") != 0) { return false; } // int idx; // for (idx = 0; idx < 20; idx++) printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"); return true; } struct esh_plugin esh_module = { .rank = 1, .init = init_plugin, .process_builtin = clean_screen_builtin };