From 42aa37edb414abc5414097370e65f546e9a0f3f7 Mon Sep 17 00:00:00 2001 From: midipix Date: Sun, 1 May 2016 15:32:08 -0400 Subject: argv.h: usage screen generator: added basic paradigm support. --- src/internal/argv/argv.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/internal') diff --git a/src/internal/argv/argv.h b/src/internal/argv/argv.h index a29bdce..cb19198 100644 --- a/src/internal/argv/argv.h +++ b/src/internal/argv/argv.h @@ -859,6 +859,7 @@ static void argv_usage( while (*mark && (mark > desc) && (*mark != ' ') + && (*mark != '|') && (*mark != '\t') && (*mark != '\n')) mark--; @@ -868,6 +869,9 @@ static void argv_usage( ? cap : desc + desclen; cache = *mark; *mark = 0; + } else if (*mark == '|') { + cache = *mark; + *mark = 0; } else { cache = 0; *mark = 0; @@ -877,7 +881,11 @@ static void argv_usage( if (desc == description) fprintf(stdout,"%s%s\n",optstr,desc); else - fprintf(stdout,"%-*c %s\n",(int)optlen,' ',desc); + fprintf(stdout,"%-*c %s\n", + (*desc == '|') + ? (int)(optlen+1) + : (int)optlen, + ' ',desc); if (cache) *mark = cache; -- cgit v1.2.3