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>2021-02-02 11:30:37 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-02-02 11:34:47 +0300
commit1d77302fd9ea9b3892ebdcf28150b3f7d40aeb21 (patch)
treec7e30d0edd10ed47b2efcecb330127b911865ebf
parentd917d7cf948579f6aee58863f16225ed6e5ec2a0 (diff)
creator: add missing '--debug-*' arguments under debugging options
Only print "Other Options" when the heading has content to show.
-rw-r--r--source/blender/blenlib/BLI_args.h2
-rw-r--r--source/blender/blenlib/intern/BLI_args.c10
-rw-r--r--source/creator/creator_args.c25
3 files changed, 30 insertions, 7 deletions
diff --git a/source/blender/blenlib/BLI_args.h b/source/blender/blenlib/BLI_args.h
index b12b7ff5d1e..5d9c168a9bd 100644
--- a/source/blender/blenlib/BLI_args.h
+++ b/source/blender/blenlib/BLI_args.h
@@ -72,6 +72,8 @@ void BLI_args_parse(struct bArgs *ba, int pass, BA_ArgCallback default_cb, void
void BLI_args_print_arg_doc(struct bArgs *ba, const char *arg);
void BLI_args_print_other_doc(struct bArgs *ba);
+bool BLI_args_has_other_doc(const struct bArgs *ba);
+
void BLI_args_print(struct bArgs *ba);
#ifdef __cplusplus
diff --git a/source/blender/blenlib/intern/BLI_args.c b/source/blender/blenlib/intern/BLI_args.c
index 3d4521a3304..07ab4f407f2 100644
--- a/source/blender/blenlib/intern/BLI_args.c
+++ b/source/blender/blenlib/intern/BLI_args.c
@@ -275,6 +275,16 @@ void BLI_args_print_other_doc(struct bArgs *ba)
}
}
+bool BLI_args_has_other_doc(const struct bArgs *ba)
+{
+ for (const bArgDoc *d = ba->docs.first; d; d = d->next) {
+ if (d->done == 0) {
+ return true;
+ }
+ }
+ return false;
+}
+
void BLI_args_parse(struct bArgs *ba, int pass, BA_ArgCallback default_cb, void *default_data)
{
BLI_assert((pass != 0) && (pass >= -1));
diff --git a/source/creator/creator_args.c b/source/creator/creator_args.c
index db63f8fbcfe..6836cbec18c 100644
--- a/source/creator/creator_args.c
+++ b/source/creator/creator_args.c
@@ -496,7 +496,7 @@ static const char arg_handle_print_help_doc[] =
"Print this help text and exit.";
static const char arg_handle_print_help_doc_win32[] =
"\n\t"
- "Print this help text and exit (windows only).";
+ "Print this help text and exit (Windows only).";
static int arg_handle_print_help(int UNUSED(argc), const char **UNUSED(argv), void *data)
{
bArgs *ba = (bArgs *)data;
@@ -586,10 +586,12 @@ static int arg_handle_print_help(int UNUSED(argc), const char **UNUSED(argv), vo
BLI_args_print_arg_doc(ba, "--debug-depsgraph-no-threads");
BLI_args_print_arg_doc(ba, "--debug-depsgraph-time");
BLI_args_print_arg_doc(ba, "--debug-depsgraph-pretty");
+ BLI_args_print_arg_doc(ba, "--debug-depsgraph-uuid");
+ BLI_args_print_arg_doc(ba, "--debug-ghost");
BLI_args_print_arg_doc(ba, "--debug-gpu");
- BLI_args_print_arg_doc(ba, "--debug-gpumem");
- BLI_args_print_arg_doc(ba, "--debug-gpu-shaders");
BLI_args_print_arg_doc(ba, "--debug-gpu-force-workarounds");
+ BLI_args_print_arg_doc(ba, "--debug-gpu-shaders");
+ BLI_args_print_arg_doc(ba, "--debug-gpumem");
BLI_args_print_arg_doc(ba, "--debug-wm");
# ifdef WITH_XR_OPENXR
BLI_args_print_arg_doc(ba, "--debug-xr");
@@ -600,9 +602,12 @@ static int arg_handle_print_help(int UNUSED(argc), const char **UNUSED(argv), vo
printf("\n");
BLI_args_print_arg_doc(ba, "--debug-fpe");
+ BLI_args_print_arg_doc(ba, "--debug-exit-on-error");
BLI_args_print_arg_doc(ba, "--disable-crash-handler");
BLI_args_print_arg_doc(ba, "--disable-abort-handler");
+ BLI_args_print_arg_doc(ba, "--verbose");
+
printf("\n");
printf("Misc Options:\n");
BLI_args_print_arg_doc(ba, "--app-template");
@@ -619,6 +624,7 @@ static int arg_handle_print_help(int UNUSED(argc), const char **UNUSED(argv), vo
printf("\n");
BLI_args_print_arg_doc(ba, "--help");
+ BLI_args_print_arg_doc(ba, "/?");
/* WIN32 only (ignored for non-win32) */
BLI_args_print_arg_doc(ba, "-R");
@@ -631,10 +637,15 @@ static int arg_handle_print_help(int UNUSED(argc), const char **UNUSED(argv), vo
// printf("\n");
// printf("Experimental Features:\n");
- /* Other options _must_ be last (anything not handled will show here) */
- printf("\n");
- printf("Other Options:\n");
- BLI_args_print_other_doc(ba);
+ /* Other options _must_ be last (anything not handled will show here).
+ *
+ * Note that it's good practice for this to remain empty,
+ * nevertheless print if any exist. */
+ if (BLI_args_has_other_doc(ba)) {
+ printf("\n");
+ printf("Other Options:\n");
+ BLI_args_print_other_doc(ba);
+ }
printf("\n");
printf("Argument Parsing:\n");