.SH OPTIONS
Mandatory arguments to long options are mandatory for short options too.
.TP
-.BI "\-c, \--config " "CONFIG-FILE"
+.BI "\-C, \-\-cmd " "CMD"
+Run \fICMD\fP as ex command line right before the first page is loaded.
+Several ex commands can be used separated by "|".
+.br
+Example: `vimb --cmd "set cookie-accept=origin|set header=Referer,DNT=1"`
+.TP
+.BI "\-c, \-\-config " "CONFIG-FILE"
Use custom configuration given as \fICONFIG-FILE\fP.
.TP
.BI "\-e, \-\-embed " "WINID"
static char *winid = NULL;
static gboolean ver = false;
static GError *err;
+ static char *cmd = NULL;
vb.custom_config = NULL;
static GOptionEntry opts[] = {
- {"version", 'v', 0, G_OPTION_ARG_NONE, &ver, "Print version", NULL},
+ {"cmd", 'C', 0, G_OPTION_ARG_STRING, &cmd, "Ex command run before first page is loaded", NULL},
{"config", 'c', 0, G_OPTION_ARG_STRING, &vb.custom_config, "Custom cufiguration file", NULL},
{"embed", 'e', 0, G_OPTION_ARG_STRING, &winid, "Reparents to window specified by xid", NULL},
+ {"version", 'v', 0, G_OPTION_ARG_NONE, &ver, "Print version", NULL},
{NULL}
};
/* Initialize GTK+ */
init_core();
+ /* process the --cmd if this was given */
+ if (cmd) {
+ ex_run_string(cmd);
+ }
+
/* command line argument: URL */
vb_load_uri(&(Arg){VB_TARGET_CURRENT, argc > 1 ? argv[argc - 1] : NULL});