diff options
Diffstat (limited to 'src/pproc.cpp')
-rw-r--r-- | src/pproc.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/pproc.cpp b/src/pproc.cpp index ea836eb..55de6fe 100644 --- a/src/pproc.cpp +++ b/src/pproc.cpp | |||
@@ -4,9 +4,19 @@ | |||
4 | 4 | ||
5 | void pprocHelp( PPROC *pproc ) | 5 | void pprocHelp( PPROC *pproc ) |
6 | { | 6 | { |
7 | int maxlen = 0; | ||
7 | for( int j = 0; pproc[j].proc || pproc[j].stateVar; j++ ) | 8 | for( int j = 0; pproc[j].proc || pproc[j].stateVar; j++ ) |
8 | { | 9 | { |
9 | printf("%c, %s - %s\n", | 10 | int len = strlen( pproc[j].lpWord ); |
11 | if( len > maxlen ) maxlen = len; | ||
12 | } | ||
13 | |||
14 | char fmt[100]; | ||
15 | sprintf( fmt, " -%%c, --%%-%ds %%s\n", maxlen ); | ||
16 | |||
17 | for( int j = 0; pproc[j].proc || pproc[j].stateVar; j++ ) | ||
18 | { | ||
19 | printf( fmt, | ||
10 | pproc[j].cChar, | 20 | pproc[j].cChar, |
11 | pproc[j].lpWord, | 21 | pproc[j].lpWord, |
12 | pproc[j].shortHelp ); | 22 | pproc[j].shortHelp ); |