2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-08-21 18:50:28 +00:00

Merge pull request #7191 from gurevichmark/xcatprobe_width

Better formatting for xcatprobe output
This commit is contained in:
besawn
2022-06-06 14:11:16 -04:00
committed by GitHub

View File

@@ -100,7 +100,10 @@ sub format_cmd_output {
$msg =~ s/\t/ /g;
my $flaglen = 6;
my $desiredwidth = 120;
my $screenwidth = (`tput cols` + 0);
my $screenwidth = 80;
if ($ENV{'TERM'}) {
$screenwidth = (`tput cols` + 0);
}
my $maxlen = ($screenwidth > $desiredwidth ? $desiredwidth : $screenwidth);
my @finalmsg = ();
@@ -194,7 +197,10 @@ sub listvalidsubcmd {
$maxlen += 4;
my $desiredwidth = 120;
my $screenwidth = (`tput cols` + 0);
my $screenwidth = 80;
if ($ENV{'TERM'}) {
$screenwidth = (`tput cols` + 0);
}
my $finallen = ($screenwidth > $desiredwidth ? $desiredwidth : $screenwidth);
print "Supported sub commands are:\n";