• Peter Maydell's avatar
    linux-user: Fix layout of usage table to account for option text · 63ec54d7
    Peter Maydell authored
    The linux-user usage message attempts to line up the columns in
    its table by calculating the maximum width of any item in them.
    However for the 'Argument' column it was only accounting for the
    length of the option switch (eg "-d"), not the additional example
    text (eg "item[,...]"). This currently has no adverse effects
    because the widest item in the column happens to be the argumentless
    "-singlestep" option, but improving the "-d" option help to read
    "-d item[,...]" exceeds that limit.
    Fix this by correctly calculating maxarglen as the width of the
    first column text including a possible option argument, and
    adjusting its uses to match.
    Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
    Signed-off-by: default avatarRiku Voipio <riku.voipio@linaro.org>
main.c 127 KB