* tta/C/texi2any.c (check_integer_option, main): add
check_integer_option that aborts with an error message similar the the
one in Perl if an integer option is not an integer.  Call for the
options that are integer and not obsolete.
diff --git a/ChangeLog b/ChangeLog
index f6c96ed..c5bd0e3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2025-08-24 Patrice Dumas  <pertusus@free.fr>
 
+	* tta/C/texi2any.c (check_integer_option, main): add
+	check_integer_option that aborts with an error message similar the the
+	one in Perl if an integer option is not an integer.  Call for the
+	options that are integer and not obsolete.
+
+2025-08-24 Patrice Dumas  <pertusus@free.fr>
+
 	* tta/C/convert/format_html.c (contents_inline_element): free
 	table_of_contents when it is the empty string.
 
diff --git a/tta/C/texi2any.c b/tta/C/texi2any.c
index 1f42782..1efd0f1 100644
--- a/tta/C/texi2any.c
+++ b/tta/C/texi2any.c
@@ -896,6 +896,33 @@
 };
 #undef IFFORMAT_TABLE
 
+void
+check_integer_option (int option_character, int option_index,
+                      const char *optarg)
+{
+  char *formatted_message;
+  char *encoded_message;
+
+  if (is_ascii_digit (optarg))
+    return;
+
+  if (option_index > 0) {
+    xasprintf (&formatted_message,
+        _("%s: value \"%s\" invalid for option %s (number expected)"),
+          program_file, optarg, long_options[option_index].name);
+  } else {
+    xasprintf (&formatted_message,
+        _("%s: value \"%s\" invalid for option %c (number expected)"),
+          program_file, optarg, option_character);
+  }
+
+  encoded_message = GNUT_encode_message (formatted_message);
+  free (formatted_message);
+  fprintf (stderr, "%s\n", encoded_message);
+  free (encoded_message);
+  exit (EXIT_FAILURE);
+}
+
 static const char *possible_split[] = {
   "chapter", "section", "node", NULL
 };
@@ -1270,6 +1297,8 @@
     {
       int option_character;
 
+      getopt_long_index = 0;
+
       option_character = getopt_long (argc, argv, "VhvFc:D:e:f:I:P:o:E:U:",
                                       long_options,
                                       &getopt_long_index);
@@ -1324,17 +1353,20 @@
           }
           break;
         case DEBUG_OPT:
+          check_integer_option (option_character, getopt_long_index, optarg);
           GNUT_set_from_cmdline (&cmdline_options,
                             cmdline_options.options->DEBUG.number,
                             optarg);
           add_string ("--debug", &texi2dvi_args);
           break;
         case 'e':
+          check_integer_option (option_character, getopt_long_index, optarg);
           GNUT_set_from_cmdline (&cmdline_options,
                             cmdline_options.options->ERROR_LIMIT.number,
                             optarg);
           break;
         case 'f':
+          check_integer_option (option_character, getopt_long_index, optarg);
           GNUT_set_from_cmdline (&cmdline_options,
                             cmdline_options.options->FILLCOLUMN.number,
                             optarg);