]> git.tue.mpg.de Git - gsu.git/commit
subcommand: Improve formatting of command list.
authorAndre Noll <maan@tuebingen.mpg.de>
Wed, 2 Aug 2023 20:35:16 +0000 (22:35 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 20 Aug 2023 14:27:44 +0000 (16:27 +0200)
commit7975dbb183a73844f4ea2f9475a44681fda6ed0c
treea3c59f4b7aaa1c9a1364b80b433483c06509f5c8
parent5dfe50002b64c19dab9625360165a3415f03eb99
subcommand: Improve formatting of command list.

If a gsu application is run without specifying a subcommand we print
the available subcommands in tabular form. Currently, this output
always consists of four columns and we also assume that the length
of a subcommand name is shorter than 16 characters. If longer names
exist, the help output is formatted incorrectly. This commit should
fix that. We now compute the maximal command length and the width of
the terminal upfront, and derive the number of columns for the output
from this information.
subcommand