summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2015-12-23 22:26:29 -0500
committermidipix <writeonce@midipix.org>2015-12-23 22:51:29 -0500
commit8d9552410f1728558e152e18ef5d438704b0a4b1 (patch)
tree7b82a8f41305896861625e1d911447588d995181 /src
parent4b561baa5d49d17ca036a2ce2ac1b58d3412cd15 (diff)
downloadsofort-8d9552410f1728558e152e18ef5d438704b0a4b1.tar.bz2
sofort-8d9552410f1728558e152e18ef5d438704b0a4b1.tar.xz
argv.h: allow the tab width to be customized.
Diffstat (limited to 'src')
-rw-r--r--src/internal/argv/argv.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/internal/argv/argv.h b/src/internal/argv/argv.h
index 319c8bd..1d5f687 100644
--- a/src/internal/argv/argv.h
+++ b/src/internal/argv/argv.h
@@ -21,6 +21,10 @@
#define ARGV_VERBOSITY_STATUS 0x02
#define ARGV_CLONE_VECTOR 0x80
+#ifndef ARGV_TAB
+#define ARGV_TAB 8
+#endif
+
enum argv_optarg {
ARGV_OPTARG_NONE,
ARGV_OPTARG_REQUIRED,
@@ -665,12 +669,12 @@ static void argv_usage(
}
}
- optlen += 8;
- optlen &= (~7);
+ optlen += ARGV_TAB;
+ optlen &= (~(ARGV_TAB-1));
if (paralen) {
- paralen += (8);
- paralen &= (~7);
+ paralen += (ARGV_TAB);
+ paralen &= (~(ARGV_TAB-1));
mparalen = paralen + 2*rbblen;
if (optlen + paralen > 64)
@@ -678,10 +682,10 @@ static void argv_usage(
}
/* account for ' ','\t', try to fit in 80 or 96 columns */
- if (optlen+paralen+2+8 < 80-32)
- desclen = 80 - (optlen+paralen+2+8);
- else if (optlen+paralen+2+8 < 96-32)
- desclen = 96 - (optlen+paralen+2+8);
+ if (optlen+paralen+2+ARGV_TAB < 80-32)
+ desclen = 80 - (optlen+paralen+2+ARGV_TAB);
+ else if (optlen+paralen+2+ARGV_TAB < 96-32)
+ desclen = 96 - (optlen+paralen+2+ARGV_TAB);
else
desclen = 32;