summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenedikt Morbach <benedikt.morbach@googlemail.com>2014-09-15 16:37:53 +0200
committerBehnam Esfahbod <behnam@behnam.es>2014-12-06 02:07:07 -0800
commit27b9250ca4dd328bcc8eff6fd4d72914a0b6bde7 (patch)
tree8e02ad0500ef68f5d9cf4ac879f7ee79cbc10fd4
parent5623ca5bf39ae6fc04442d309aa6bec923d569f6 (diff)
downloadfribidi-27b9250ca4dd328bcc8eff6fd4d72914a0b6bde7.tar.gz
ignore COLUMNS for --help and --test
also fix a bug in the --help output. With COLUMNS=123 it would display "default is 123 but if COLUMNS is set..." instead of "default is 80 but if COLUMNS is set..." https://bugs.freedesktop.org/show_bug.cgi?id=83892
-rw-r--r--bin/fribidi-main.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/bin/fribidi-main.c b/bin/fribidi-main.c
index a813650..b95e856 100644
--- a/bin/fribidi-main.c
+++ b/bin/fribidi-main.c
@@ -92,6 +92,7 @@ die2 (
fribidi_boolean do_break, do_pad, do_mirror, do_reorder_nsm, do_clean;
fribidi_boolean show_input, show_visual, show_basedir;
fribidi_boolean show_ltov, show_vtol, show_levels;
+const int default_text_width = 80;
int text_width;
const char *char_set;
const char *bol_text, *eol_text;
@@ -119,7 +120,8 @@ help (
printf (" -d, --debug Output debug information\n"
" -t, --test Test " FRIBIDI_NAME
", same as --clean --nobreak\n"
- " --showinput --reordernsm\n");
+ " --showinput --reordernsm --width %d\n",
+ default_text_width);
#if FRIBIDI_MAIN_USE_ICONV_H+0
printf (" -c, --charset CS Specify character set, default is %s.\n"
" CS should be a valid iconv character set name\n",
@@ -136,7 +138,7 @@ help (
" -w, --width W Screen width for padding, default is %d, but if\n"
" environment variable COLUMNS is defined, its value\n"
" will be used, --width overrides both of them.\n",
- text_width);
+ default_text_width);
printf
(" -B, --bol BOL Output string BOL before the visual string\n"
" -E, --eol EOL Output string EOL after the visual string\n"
@@ -215,7 +217,7 @@ main (
char *s;
FILE *IN;
- text_width = 80;
+ text_width = default_text_width;
do_break = true;
do_pad = true;
do_mirror = true;
@@ -324,6 +326,7 @@ main (
case 't':
do_clean = show_input = do_reorder_nsm = true;
do_break = false;
+ text_width = default_text_width;
break;
case 'c':
char_set = my_fribidi_strdup (optarg);