File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 2424#include <common/textbuffer.h>
2525#include <common/cr_string.h>
2626
27+ // FIXME: Replace this whole thing with getopt
28+
2729static void printUsage (const char * progname ) {
2830 printf ("Usage: %s [-hjsdtocv] [input_json...]\n" , progname );
2931 printf (" Available options are:\n" );
@@ -41,6 +43,7 @@ static void printUsage(const char *progname) {
4143 printf (" [--nodes <list>] -> Use worker nodes in comma-separated ip:port list for a faster render (Experimental)\n" );
4244 printf (" [--shutdown] -> Use in conjunction with a node list to send a shutdown command to a list of clients\n" );
4345 printf (" [--asset-path] -> Specify an asset path to load assets from, useful in scripts\n" );
46+ printf (" [--no-sdl] -> Disable render preview window\n" );
4447 // printf(" [--test] -> Run the test suite\n"); // FIXME
4548 term_restore ();
4649 exit (0 );
@@ -229,6 +232,10 @@ struct driver_args *args_parse(int argc, char **argv) {
229232 setDatabaseInt (args , "worker_port" , port );
230233 }
231234 }
235+
236+ if (stringEquals (argv [i ], "--no-sdl" )) {
237+ setDatabaseTag (args , "no_sdl" );
238+ }
232239
233240 if (strncmp (argv [i ], "-" , 1 ) == 0 ) {
234241 int vees = 0 ;
Original file line number Diff line number Diff line change @@ -245,7 +245,8 @@ int main(int argc, char *argv[]) {
245245 .should_save = true,
246246 .win_mutex = mutex_create (),
247247 };
248- cr_renderer_set_callback (renderer , cr_cb_on_start , on_start , & usrdata );
248+ if (!args_is_set (opts , "no_sdl" ))
249+ cr_renderer_set_callback (renderer , cr_cb_on_start , on_start , & usrdata );
249250 cr_renderer_set_callback (renderer , cr_cb_on_stop , on_stop , & usrdata );
250251 cr_renderer_set_callback (renderer , cr_cb_status_update , status , & usrdata );
251252
You can’t perform that action at this time.
0 commit comments