Skip to content

fix a few typos on cli help and error messages#714

Merged
leejet merged 3 commits into
leejet:masterfrom
wbruna:fix_typos
Jul 4, 2025
Merged

fix a few typos on cli help and error messages#714
leejet merged 3 commits into
leejet:masterfrom
wbruna:fix_typos

Conversation

@wbruna

@wbruna wbruna commented Jul 1, 2025

Copy link
Copy Markdown
Contributor

Not sure if it'd be better to build a dynamic string for the mode list.

Comment thread examples/cli/main.cpp Outdated
printf("arguments:\n");
printf(" -h, --help show this help message and exit\n");
printf(" -M, --mode [MODEL] run mode (txt2img or img2img or convert, default: txt2img)\n");
printf(" -M, --mode {%s}\n", SD_ALL_MODES_STR);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

god yes, this has bothered me at a couple of occasions, but I always forget it again.

@leejet

leejet commented Jul 2, 2025

Copy link
Copy Markdown
Owner

I think it would be better to keep the description of the --mode arguement.

@wbruna

wbruna commented Jul 2, 2025

Copy link
Copy Markdown
Contributor Author

I think it would be better to keep the description of the --mode arguement.

You mean on the same line and keeping [MODE], like this?

diff --git a/examples/cli/main.cpp b/examples/cli/main.cpp
index 23166df..18be80b 100644
--- a/examples/cli/main.cpp
+++ b/examples/cli/main.cpp
@@ -200,8 +200,7 @@ void print_usage(int argc, const char* argv[]) {
     printf("\n");
     printf("arguments:\n");
     printf("  -h, --help                         show this help message and exit\n");
-    printf("  -M, --mode {%s}\n", SD_ALL_MODES_STR);
-    printf("                                     run mode (default: txt2img)\n");
+    printf("  -M, --mode [MODE]                  run mode (one of %s; default: txt2img)\n", SD_ALL_MODES_STR);
     printf("  -t, --threads N                    number of threads to use during computation (default: -1)\n");
     printf("                                     If threads <= 0, then threads will be set to the number of CPU physical cores\n");
     printf("  -m, --model [MODEL]                path to full model\n");

I was trying to follow the other multi-choice options pattern, because that line is getting rather long (but no strong feelings about it).

@wbruna

wbruna commented Jul 2, 2025

Copy link
Copy Markdown
Contributor Author

We could also add full descriptions instead:

diff --git a/examples/cli/main.cpp b/examples/cli/main.cpp
index 23166df..ec8401b 100644
--- a/examples/cli/main.cpp
+++ b/examples/cli/main.cpp
@@ -200,8 +200,12 @@ void print_usage(int argc, const char* argv[]) {
     printf("\n");
     printf("arguments:\n");
     printf("  -h, --help                         show this help message and exit\n");
-    printf("  -M, --mode {%s}\n", SD_ALL_MODES_STR);
-    printf("                                     run mode (default: txt2img)\n");
+    printf("  -M, --mode [MODE]                  run mode, one of:\n");
+    printf("                                     txt2img: generate an image from a text prompt (default)\n");
+    printf("                                     img2img: generate an image from a text prompt and an initial image (--init-img)\n");
+    printf("                                     img2vid: generate a video from a text prompt and an initial image (--init-img)\n");
+    printf("                                     edit:    modify an image (--ref-image) based on text instructions\n");
+    printf("                                     convert: convert a model file to gguf format, optionally with quantization\n");
     printf("  -t, --threads N                    number of threads to use during computation (default: -1)\n");
     printf("                                     If threads <= 0, then threads will be set to the number of CPU physical cores\n");
     printf("  -m, --model [MODEL]                path to full model\n");

(I can update the PR, but feel free to change it directly if you wish)

@leejet

leejet commented Jul 3, 2025

Copy link
Copy Markdown
Owner

We could also add full descriptions instead:

diff --git a/examples/cli/main.cpp b/examples/cli/main.cpp
index 23166df..ec8401b 100644
--- a/examples/cli/main.cpp
+++ b/examples/cli/main.cpp
@@ -200,8 +200,12 @@ void print_usage(int argc, const char* argv[]) {
     printf("\n");
     printf("arguments:\n");
     printf("  -h, --help                         show this help message and exit\n");
-    printf("  -M, --mode {%s}\n", SD_ALL_MODES_STR);
-    printf("                                     run mode (default: txt2img)\n");
+    printf("  -M, --mode [MODE]                  run mode, one of:\n");
+    printf("                                     txt2img: generate an image from a text prompt (default)\n");
+    printf("                                     img2img: generate an image from a text prompt and an initial image (--init-img)\n");
+    printf("                                     img2vid: generate a video from a text prompt and an initial image (--init-img)\n");
+    printf("                                     edit:    modify an image (--ref-image) based on text instructions\n");
+    printf("                                     convert: convert a model file to gguf format, optionally with quantization\n");
     printf("  -t, --threads N                    number of threads to use during computation (default: -1)\n");
     printf("                                     If threads <= 0, then threads will be set to the number of CPU physical cores\n");
     printf("  -m, --model [MODEL]                path to full model\n");

(I can update the PR, but feel free to change it directly if you wish)

Please update the pr.

@wbruna

wbruna commented Jul 3, 2025

Copy link
Copy Markdown
Contributor Author

I added the detailed descriptions of the modes to the help text.

BTW, I've also noticed the 'SVD support is broken' message, so I'm not mentioning img2vid on the text.

@leejet leejet merged commit 76c7262 into leejet:master Jul 4, 2025
9 checks passed
@leejet

leejet commented Jul 4, 2025

Copy link
Copy Markdown
Owner

Thank you for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants