Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-08-17 09:34:51 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-08-18 07:10:07 +0300
commit506d8448cc006a0c1c51947999a50addbfedcb15 (patch)
treebec2390fcca2b7914ea2a5b022685e9248e6b3da /source/creator/creator_args.c
parentdb8ca0f17a9d9f44c63c76c79925019a2d5e1a00 (diff)
WM: app-template command line override
Without this, there was no simple way to have launchers for different app-templates. Also allows force-disabling the app-template stored in the preferences.
Diffstat (limited to 'source/creator/creator_args.c')
-rw-r--r--source/creator/creator_args.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/source/creator/creator_args.c b/source/creator/creator_args.c
index 22301bd62f5..7ad44916047 100644
--- a/source/creator/creator_args.c
+++ b/source/creator/creator_args.c
@@ -580,6 +580,7 @@ static int arg_handle_print_help(int UNUSED(argc), const char **UNUSED(argv), vo
printf("\n");
printf("Misc Options:\n");
+ BLI_argsPrintArgDoc(ba, "--app-template");
BLI_argsPrintArgDoc(ba, "--factory-startup");
printf("\n");
BLI_argsPrintArgDoc(ba, "--env-system-datafiles");
@@ -993,6 +994,22 @@ static int arg_handle_debug_fpe_set(int UNUSED(argc), const char **UNUSED(argv),
return 0;
}
+static const char arg_handle_app_template_doc[] =
+"\n\tSet the application template, use 'default' for none."
+;
+static int arg_handle_app_template(int argc, const char **argv, void *UNUSED(data))
+{
+ if (argc > 1) {
+ const char *app_template = STREQ(argv[1], "default") ? "" : argv[1];
+ WM_init_state_app_template_set(app_template);
+ return 1;
+ }
+ else {
+ printf("\nError: App template must follow '--app-template'.\n");
+ return 0;
+ }
+}
+
static const char arg_handle_factory_startup_set_doc[] =
"\n\tSkip reading the " STRINGIFY(BLENDER_STARTUP_FILE) " in the users home directory."
;
@@ -2043,6 +2060,7 @@ void main_args_setup(bContext *C, bArgs *ba, SYS_SystemHandle *syshandle)
BLI_argsAdd(ba, 1, NULL, "--verbose", CB(arg_handle_verbosity_set), NULL);
+ BLI_argsAdd(ba, 1, NULL, "--app-template", CB(arg_handle_app_template), NULL);
BLI_argsAdd(ba, 1, NULL, "--factory-startup", CB(arg_handle_factory_startup_set), NULL);
/* TODO, add user env vars? */