This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository legacy-imlib2.

View the commit online.

commit 6a8ed3b3f02caf3726044f8690aafc8cf802fbef
Author: Kim Woelders <k...@woelders.dk>
AuthorDate: Sat Dec 14 08:13:46 2024 +0100

    imlib2_load/view: Add -h option for help
---
 src/bin/imlib2_load.c |  7 ++++++-
 src/bin/imlib2_view.c | 10 ++++++----
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/bin/imlib2_load.c b/src/bin/imlib2_load.c
index 34fdbea..ea8641f 100644
--- a/src/bin/imlib2_load.c
+++ b/src/bin/imlib2_load.c
@@ -39,6 +39,7 @@ static FILE    *fout;
    "  -c  : Enable image caching\n" \
    "  -e  : Break on error\n" \
    "  -f  : Load with imlib_load_image_fd()\n" \
+   "  -h  : Show help\n" \
    "  -i  : Load image immediately (don't defer data loading)\n" \
    "  -j  : Load image header only\n" \
    "  -m  : Load with imlib_load_image_mem()\n" \
@@ -173,10 +174,14 @@ main(int argc, char **argv)
     opt_cache = false;
     show_crc = false;
 
-    while ((opt = getopt(argc, argv, "Ccefijmn:pvx")) != -1)
+    while ((opt = getopt(argc, argv, "Ccefhijmn:pvx")) != -1)
     {
         switch (opt)
         {
+        default:
+        case 'h':
+            usage();
+            return 1;
         case 'C':
             show_crc = true;
             break;
diff --git a/src/bin/imlib2_view.c b/src/bin/imlib2_view.c
index 3aa7106..387378f 100644
--- a/src/bin/imlib2_view.c
+++ b/src/bin/imlib2_view.c
@@ -85,6 +85,7 @@ static int      animloop = 0;   /* Animation loop count          */
    "  -c         : Enable image caching (implies -e)\n" \
    "  -d         : Enable debug\n" \
    "  -e         : Do rendering explicitly (not via progress callback)\n" \
+   "  -h         : Show help\n" \
    "  -g N       : Set progress granularity to N%% (default 10(%%))\n" \
    "  -l N       : Introduce N ms delay in progress callback (default 0)\n" \
    "  -p         : Print info in progress callback (default no)\n" \
@@ -631,10 +632,14 @@ main(int argc, char **argv)
 
     verbose = 0;
 
-    while ((opt = getopt(argc, argv, "ab:cdeg:l:ps:S:t:T:v")) != -1)
+    while ((opt = getopt(argc, argv, "ab:cdeg:hl:ps:S:t:T:v")) != -1)
     {
         switch (opt)
         {
+        default:
+        case 'h':
+            usage();
+            return 1;
         case 'a':
             opt_aa_final = false;
             break;
@@ -691,9 +696,6 @@ main(int argc, char **argv)
         case 'v':
             verbose += 1;
             break;
-        default:
-            usage();
-            return 1;
         }
     }
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to