linux-user: Fix layout of usage table to account for option text
commit63ec54d7b319824df8b60cfe25afdfb607ce3905
authorPeter Maydell <peter.maydell@linaro.org>
Thu, 14 Feb 2013 08:46:43 +0000 (14 08:46 +0000)
committerRiku Voipio <riku.voipio@linaro.org>
Mon, 11 Mar 2013 12:33:42 +0000 (11 14:33 +0200)
treea87d997b511ece8f942bab7905342fed0655807e
parent0d95fda86b0d69fc4010f6bb37aa4fd38f1addff
linux-user: Fix layout of usage table to account for option text

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: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
linux-user/main.c