Commit 7c252361 authored by sagnowski's avatar sagnowski
Browse files

CmdLnParser: Print whitespace using fprintf

parent 8e4664ea
Loading
Loading
Loading
Loading
+2 −14
Original line number Diff line number Diff line
@@ -345,17 +345,6 @@ static int32_t totalNumOptChars(
    return len;
}

static void printWhitespace(
    const int32_t n )
{
    assert( n >= 0 );

    for ( int32_t i = 0; i < n; ++i )
    {
        fprintf( stderr, " " );
    }
}

static void printOptDescriptionAligned(
    const char *descPtr,
    int32_t descriptionColumnIdx )
@@ -377,7 +366,7 @@ static void printOptDescriptionAligned(
        fprintf( stderr, "%c", *descPtr );
        if ( *descPtr == '\n' )
        {
            printWhitespace( descriptionColumnIdx );
            fprintf( stderr, "%*s", descriptionColumnIdx, "" );
        }
        ++descPtr;
    }
@@ -423,8 +412,7 @@ static void printOptions(
        if ( opt.description != NULL )
        {
            /* Done printing options column, fill with whitespace until description column */
            printWhitespace( descriptionColumnIdx - numOptChars - 2 /* account for ": " below */ );
            fprintf( stderr, ": " );
            fprintf( stderr, "%*s",  descriptionColumnIdx - numOptChars, ": " );
            printOptDescriptionAligned( opt.description, descriptionColumnIdx );
        }
        else