2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-03 03:50:08 +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
commit 79d2503e77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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";