enum {
CONFIG,
PLUGIN,
+ LOAD_PLUGIN,
MODULE,
LOOP,
PASS,
enum arg_type {
ARG_FILE,
ARG_STDIN,
+ ARG_LOAD_PLUGIN,
ARG_DEFINE,
ARG_UNDEF,
ARG_INCLUDE,
case ARG_STDIN:
compile_file(gwion, "stdin", stdin);
break;
+ case ARG_LOAD_PLUGIN:
+ char c[1024];
+ sprintf(c, "#import %s\n", VPTR(v, ++i));
+ compile_string(gwion, "<command-line>", c);
+ break;
case ARG_DEFINE:
pparg_add(gwion->ppa, (m_str)VPTR(v, ++i));
break;
"number of input channel", &opt[NINPUT]);
cmdapp_set(app, 'o', "output", CMDOPT_TAKESARG, NULL,
"number of output channel", &opt[NOUTPUT]);
+ cmdapp_set(app, 'P', "plugin", CMDOPT_TAKESARG, NULL, "(force-)load a plugin",
+ &opt[LOAD_PLUGIN]);
cmdapp_set(app, 'D', "define", CMDOPT_TAKESARG, NULL, "define a macro",
&opt[DEFINE]);
cmdapp_set(app, 'U', "undef", CMDOPT_TAKESARG, NULL, "undefine a macro",
case '\0':
vector_add(&_arg->add, (vtype)ARG_STDIN);
break;
+ case 'P':
+ vector_add(&_arg->add, (vtype)ARG_LOAD_PLUGIN);
+ vector_add(&_arg->add, (vtype)option->value);
+ break;
case 'c':
if (!strcmp(option->value, "never"))
_arg->color = COLOR_NEVER;