New version, new man page. Bug fixes, feature/output tweaks.

Bugs fixed:
1. stray undefined value corrected
2. fixed BSD no pkg server case, now shows correctly that no pkg server files
were found, not that the OS is not supported.

Features:
1. -t c and m headers cleaned up and simplified
2. man page edits.
3. more standarization of key names for fields, some spelling
and upper/lower case corrections.
This commit is contained in:
Harald Hope 2018-03-26 15:03:15 -07:00
parent 0f0433dc9a
commit 9e9a67168d
3 changed files with 95 additions and 40 deletions

95
inxi
View file

@ -36,8 +36,8 @@ use POSIX qw(uname strftime ttyname);
## INXI INFO ## ## INXI INFO ##
my $self_name='inxi'; my $self_name='inxi';
my $self_version='2.9.07'; my $self_version='2.9.08';
my $self_date='2018-03-25'; my $self_date='2018-03-26';
my $self_patch='00'; my $self_patch='00';
## END INXI INFO ## ## END INXI INFO ##
@ -2994,6 +2994,7 @@ sub program_version {
if ( $ENV{'KSH_VERSION'} ){ if ( $ENV{'KSH_VERSION'} ){
my @temp = split /\s+/, $ENV{'KSH_VERSION'}; my @temp = split /\s+/, $ENV{'KSH_VERSION'};
if ($temp[2]){ if ($temp[2]){
$temp[2] =~ s/^v//i; # trim off leading v
log_data('data',"Program *ksh array: @temp version: $temp[2]") if $b_log; log_data('data',"Program *ksh array: @temp version: $temp[2]") if $b_log;
return $temp[2]; return $temp[2];
} }
@ -3323,8 +3324,8 @@ sub get_options{
eval $start if $b_log; eval $start if $b_log;
my (@args) = @_; my (@args) = @_;
$show{'short'} = 1; $show{'short'} = 1;
my ($b_downloader,$b_no_man,$b_no_man_force,$b_recommends,$b_updater, my ($b_downloader,$b_no_man,$b_no_man_force,$b_recommends,$b_updater,$b_version,
$b_version,$b_use_man,$help_type,$self_download, $download_id); $b_use_man,$help_type,$self_download, $download_id);
GetOptions ( GetOptions (
'A|audio' => sub { 'A|audio' => sub {
$show{'short'} = 0; $show{'short'} = 0;
@ -3529,7 +3530,7 @@ sub get_options{
} }
if ($arg >= 7 ){ if ($arg >= 7 ){
$b_downloader = 1 if ! check_program('dig'); $b_downloader = 1 if ! check_program('dig');
$show{'flag'} = 1; $show{'cpu-flag'} = 1;
$show{'ip'} = 1; $show{'ip'} = 1;
$show{'raid-forced'} = 1; $show{'raid-forced'} = 1;
$extra = 3; $extra = 3;
@ -3694,7 +3695,7 @@ sub get_options{
$help_type = 'standard'; }, $help_type = 'standard'; },
'H|help-full' => sub { 'H|help-full' => sub {
$help_type = 'full'; }, $help_type = 'full'; },
'hostname' => sub { 'host|hostname' => sub {
$show{'host'} = 1 }, $show{'host'} = 1 },
'indent-min:i' => sub { 'indent-min:i' => sub {
my ($opt,$arg) = @_; my ($opt,$arg) = @_;
@ -3721,10 +3722,10 @@ sub get_options{
else { else {
error_handler('bad-arg', $opt, $arg); error_handler('bad-arg', $opt, $arg);
}}, }},
'no-hostname' => sub { 'no-host|no-hostname' => sub {
$show{'host'} = 0 }, $show{'host'} = 0 },
'no-man' => sub { 'no-man' => sub {
$b_no_man_force = 1; }, $b_no_man_force = 0; },
'no-ssl' => sub { 'no-ssl' => sub {
$dl{'no-ssl-opt'}=1 }, $dl{'no-ssl-opt'}=1 },
'output-file:s' => sub { 'output-file:s' => sub {
@ -4129,7 +4130,7 @@ sub show_options {
['1', '', '--downloader', "Force $self_name to use [curl|fetch|perl|wget] for downloads." ], ['1', '', '--downloader', "Force $self_name to use [curl|fetch|perl|wget] for downloads." ],
['1', '', '--dmidecode', "Forces use of dmidecode data instead of /sys where ['1', '', '--dmidecode', "Forces use of dmidecode data instead of /sys where
relevant (-M)." ], relevant (-M)." ],
['1', '', '--hostname', "Turns on hostname in output." ], ['1', '', '--host', "Turns on hostname in output." ],
['1', '', '--indent-min', "Takes value 80 or greater. Increases or decreases the point ['1', '', '--indent-min', "Takes value 80 or greater. Increases or decreases the point
where $self_name autowraps line starters." ], where $self_name autowraps line starters." ],
['1', '', '--limit', "[-1 - x] -1 removes limit. Raise or lower max output limit of IP addresses for -i." ], ['1', '', '--limit', "[-1 - x] -1 removes limit. Raise or lower max output limit of IP addresses for -i." ],
@ -4143,7 +4144,7 @@ sub show_options {
push @data, @rows; push @data, @rows;
} }
@rows = ( @rows = (
['1', '', '--no-hostname', "Turns off hostname in output. Useful if showing output from ['1', '', '--no-host', "Turns off hostname in output. Useful if showing output from
servers etc." ], servers etc." ],
['1', '', '--no-ssl', "Skips SSL certificate checks for all downloader activities ['1', '', '--no-ssl', "Skips SSL certificate checks for all downloader activities
(wget/fetch/curl only)." ], (wget/fetch/curl only)." ],
@ -7623,7 +7624,8 @@ sub display_server(){
$server = $ENV{'WAYLAND_DISPLAY'} if (!$server && $ENV{'WAYLAND_DISPLAY'}); $server = $ENV{'WAYLAND_DISPLAY'} if (!$server && $ENV{'WAYLAND_DISPLAY'});
if ($extra > 1){ if ($extra > 1){
# initial tests, if wayland, it is certainly a compositor # initial tests, if wayland, it is certainly a compositor
$graphics{'compositor'} = display_compositor(lc($server)); $server = lc($server) if $server;
$graphics{'compositor'} = display_compositor($server);
} }
if ( $show{'display-data'}){ if ( $show{'display-data'}){
# X vendor and version detection. # X vendor and version detection.
@ -9954,12 +9956,15 @@ sub cpu_processes {
$b[2] <=> $a[2] } @ps_aux; $b[2] <=> $a[2] } @ps_aux;
# if there's a count limit, for irc, etc, only use that much of the data # if there's a count limit, for irc, etc, only use that much of the data
@rows = splice @rows,0,$count; @rows = splice @rows,0,$count;
$cpu_mem = ' - Memory: MiB / % used' if $extra > 0;
$j = scalar @rows; $j = scalar @rows;
# $cpu_mem = ' - Memory: MiB / % used' if $extra > 0;
my $throttled = throttled($ps_count,$count,$j); my $throttled = throttled($ps_count,$count,$j);
my @data = ( #my $header = "CPU % used - Command - pid$cpu_mem - top";
{$num++ . "#CPU % used - Command - pid$cpu_mem - top" => "$count$throttled",}, #my $header = "Top $count by CPU";
); my @data = ({
$num++ . "#CPU top" => "$count$throttled",
},);
@processes = (@processes,@data); @processes = (@processes,@data);
my $i = 1; my $i = 1;
foreach (@rows){ foreach (@rows){
@ -9967,13 +9972,11 @@ sub cpu_processes {
$j = scalar @processes; $j = scalar @processes;
my @row = split /\s+/, $_; my @row = split /\s+/, $_;
my @command = process_starter(scalar @row, $row[10],$row[11]); my @command = process_starter(scalar @row, $row[10],$row[11]);
@data = ( @data = ({
{
$num++ . "#" . $i++ => '', $num++ . "#" . $i++ => '',
$num++ . "#cpu" => $row[2] . '%', $num++ . "#cpu" => $row[2] . '%',
$num++ . "#command" => $command[0], $num++ . "#command" => $command[0],
}, },);
);
@processes = (@processes,@data); @processes = (@processes,@data);
if ($command[1]) { if ($command[1]) {
$processes[$j]{$num++ . "#started by"} = $command[1]; $processes[$j]{$num++ . "#started by"} = $command[1];
@ -10002,12 +10005,14 @@ sub mem_processes {
@rows = splice @rows,0,$count; @rows = splice @rows,0,$count;
#print Data::Dumper::Dumper \@rows; #print Data::Dumper::Dumper \@rows;
@processes = main::memory_data_full('process') if !$b_mem; @processes = main::memory_data_full('process') if !$b_mem;
$cpu_mem = ' - CPU: % used' if $extra > 0;
$j = scalar @rows; $j = scalar @rows;
my $throttled = throttled($ps_count,$count,$j); my $throttled = throttled($ps_count,$count,$j);
@data = ( #$cpu_mem = ' - CPU: % used' if $extra > 0;
{$num++ . "#Memory MiB/% used - Command - pid$cpu_mem - top" => "$count$throttled",}, #my $header = "Memory MiB/% used - Command - pid$cpu_mem - top";
); #my $header = "Top $count by Memory";
@data = ({
$num++ . "#Memory top" => "$count$throttled",
},);
@processes = (@processes,@data); @processes = (@processes,@data);
my $i = 1; my $i = 1;
foreach (@rows){ foreach (@rows){
@ -10018,13 +10023,11 @@ sub mem_processes {
$mem = ($row[5]) ? sprintf( "%.${decimals}f", $row[5]/1024 ) . ' MiB' : 'N/A'; $mem = ($row[5]) ? sprintf( "%.${decimals}f", $row[5]/1024 ) . ' MiB' : 'N/A';
my @command = process_starter(scalar @row, $row[10],$row[11]); my @command = process_starter(scalar @row, $row[10],$row[11]);
$mem .= " (" . $row[3] . "%)"; $mem .= " (" . $row[3] . "%)";
@data = ( @data = ({
{
$num++ . "#" . $i++ => '', $num++ . "#" . $i++ => '',
$num++ . "#mem" => $mem, $num++ . "#mem" => $mem,
$num++ . "#command" => $command[0], $num++ . "#command" => $command[0],
}, },);
);
@processes = (@processes,@data); @processes = (@processes,@data);
if ($command[1]) { if ($command[1]) {
$processes[$j]{$num++ . "#started by"} = $command[1]; $processes[$j]{$num++ . "#started by"} = $command[1];
@ -10060,7 +10063,7 @@ sub throttled {
my ($ps_count,$count,$j) = @_; my ($ps_count,$count,$j) = @_;
my $throttled = ''; my $throttled = '';
if ($count > $j){ if ($count > $j){
$throttled = " (only $j processes)"; $throttled = " ( $j processes)";
} }
elsif ($count < $ps_count){ elsif ($count < $ps_count){
$throttled = " (throttled from $ps_count)"; $throttled = " (throttled from $ps_count)";
@ -10677,7 +10680,7 @@ sub create_output {
$mod{'manufacturer'} ||= 'N/A'; $mod{'manufacturer'} ||= 'N/A';
$rows[$j]{$num++ . "#manufacturer"} = $mod{'manufacturer'}; $rows[$j]{$num++ . "#manufacturer"} = $mod{'manufacturer'};
$mod{'part-number'} ||= 'N/A'; $mod{'part-number'} ||= 'N/A';
$rows[$j]{$num++ . "#part-nu"} = $mod{'part-number'}; $rows[$j]{$num++ . "#part-no"} = $mod{'part-number'};
} }
if ($extra > 2 ){ if ($extra > 2 ){
$mod{'serial'} ||= 'N/A'; $mod{'serial'} ||= 'N/A';
@ -11665,6 +11668,27 @@ sub get_repos_bsd {
@data = repo_builder($netbsd,'netbsd','^\s*[^#]+$'); @data = repo_builder($netbsd,'netbsd','^\s*[^#]+$');
@rows = (@rows,@data); @rows = (@rows,@data);
} }
# BSDs do not default always to having repo files, so show correct error
# mesage in that case
if (!@rows){
if ($bsd_type eq 'freebsd'){
$key = repo_builder('missing','freebsd-nf');
}
elsif ($bsd_type eq 'openbsd'){
$key = repo_builder('missing','openbsd-nf');
}
elsif ($bsd_type eq 'netbsd'){
$key = repo_builder('missing','netbsd-nf');
}
else {
$key = repo_builder('missing','bsd-nf');
}
@data = (
{$num++ . "#Message" => $key},
[()],
);
@rows = (@rows,@data);
}
eval $start if $b_log; eval $start if $b_log;
return @rows; return @rows;
} }
@ -11676,15 +11700,19 @@ sub repo_builder {
'apk' => 'No active APK repos in', 'apk' => 'No active APK repos in',
'apt' => 'No active apt repos in', 'apt' => 'No active apt repos in',
'bsd-package' => 'No enabled BSD pkg servers in', 'bsd-package' => 'No enabled BSD pkg servers in',
'bsd-nf' => 'No BSD pkg server files found',
'eopkg' => 'No active eopkg repos found', 'eopkg' => 'No active eopkg repos found',
'pacman' => 'No active pacman repos in', 'pacman' => 'No active pacman repos in',
'pisi' => 'No active pisi repos found', 'pisi' => 'No active pisi repos found',
'portage' => 'No enabled portage sources in', 'portage' => 'No enabled portage sources in',
'portsnap' => 'No ports servers in', 'portsnap' => 'No ports servers in',
'freebsd' => 'No FreeBSD update servers in', 'freebsd' => 'No FreeBSD update servers in',
'freebsd-nf' => 'No FreeBSD update server files found',
'freebsd-pkg' => 'No FreeBSD default pkg server in', 'freebsd-pkg' => 'No FreeBSD default pkg server in',
'openbsd' => 'No OpenBSD pkg mirrors in', 'openbsd' => 'No OpenBSD pkg mirrors in',
'openbsd-nf' => 'No OpenBSD pkg mirror files found',
'netbsd' => 'No NetBSD pkg servers in', 'netbsd' => 'No NetBSD pkg servers in',
'netbsd-nf' => 'No NetBSD pkg server files found',
'slackpkg' => 'No active slackpkg repos in', 'slackpkg' => 'No active slackpkg repos in',
'slackpkg+' => 'No active slackpkg+ repos in', 'slackpkg+' => 'No active slackpkg+ repos in',
'yum' => 'No active yum repos in', 'yum' => 'No active yum repos in',
@ -12962,7 +12990,7 @@ sub create_output {
if ($extra > 2){ if ($extra > 2){
if (!$show{'filter'}){ if (!$show{'filter'}){
$rows[0]{$num++ . "#Location"} = $location[1]; $rows[0]{$num++ . "#Location"} = $location[1];
$rows[0]{$num++ . "#Altitude"} = $weather{'elevation'}; $rows[0]{$num++ . "#altitude"} = $weather{'elevation'};
} }
} }
$rows[0]{$num++ . "#Time"} = $weather{'date-time'}; $rows[0]{$num++ . "#Time"} = $weather{'date-time'};
@ -15660,9 +15688,6 @@ sub generate_info_data {
$b_gcc = 1; $b_gcc = 1;
} }
$gcc ||= 'N/A'; $gcc ||= 'N/A';
if ($extra > 0 && $client{'version'}){
$client .= ' ' . $client{'version'};
}
if (!$b_irc && $extra > 1 ){ if (!$b_irc && $extra > 1 ){
# bsds don't support -f option to get PPID # bsds don't support -f option to get PPID
if ($b_display && !$bsd_type){ if ($b_display && !$bsd_type){
@ -15744,7 +15769,11 @@ sub generate_info_data {
$data{$data_name}[$index]{$num++ . '#clang'} = $clang_version; $data{$data_name}[$index]{$num++ . '#clang'} = $clang_version;
} }
} }
$data{$data_name}[$index]{$num++ . '#' . $client_shell} = $client; $data{$data_name}[$index]{$num++ . '#' . $client_shell} = $client;
if ($extra > 0 && $client{'version'}){
$data{$data_name}[$index]{$num++ . '#v'} = $client{'version'};
}
if ( $running_in ){ if ( $running_in ){
$data{$data_name}[$index]{$num++ . '#running in'} = $running_in; $data{$data_name}[$index]{$num++ . '#running in'} = $running_in;
} }

16
inxi.1
View file

@ -1,4 +1,4 @@
.TH INXI 1 "2018\-03\-25" inxi "inxi manual" .TH INXI 1 "2018\-03\-26" inxi "inxi manual"
.SH NAME .SH NAME
inxi \- Command line system information script for console and IRC inxi \- Command line system information script for console and IRC
.SH SYNOPSIS .SH SYNOPSIS
@ -17,6 +17,7 @@ NUMBER\fR)] \fR[\fB\-x \-OPTION\fR(\fBs\fR)] \fR[\fB\-xx
\fR[\fB\-\-version\fR] \fR \fR[\fB\-\-version\fR] \fR
All options have long form variants. See below. All options have long form variants. See below.
.SH DESCRIPTION .SH DESCRIPTION
\fBinxi\fR is a command line system information script built for for console \fBinxi\fR is a command line system information script built for for console
and IRC. It is also used for forum technical support, as a debugging tool, and IRC. It is also used for forum technical support, as a debugging tool,
@ -28,6 +29,7 @@ RAM usage, and a wide variety of other useful information.
color options applied to IRC use. Script colors can be turned off if desired color options applied to IRC use. Script colors can be turned off if desired
with \fB\-c 0\fR, or changed using the \fB\-c\fR color options listed in the with \fB\-c 0\fR, or changed using the \fB\-c\fR color options listed in the
OPTIONS section below. OPTIONS section below.
.SH PRIVACY AND SECURITY .SH PRIVACY AND SECURITY
In order to maintain basic privacy and security, inxi filters out automatically In order to maintain basic privacy and security, inxi filters out automatically
on IRC things like your network card mac address, WAN and LAN IP, your \fB/home\fR on IRC things like your network card mac address, WAN and LAN IP, your \fB/home\fR
@ -37,6 +39,7 @@ Because inxi is often used on forums for support, you can also trigger this
filtering with the \fB\-z\fR option (\fB\-Fz\fR, for example). To override filtering with the \fB\-z\fR option (\fB\-Fz\fR, for example). To override
the IRC filter, you can use the \fB\-Z\fR option. This can be useful to debug the IRC filter, you can use the \fB\-Z\fR option. This can be useful to debug
network connection issues online in a private chat, for example. network connection issues online in a private chat, for example.
.SH USING OPTIONS .SH USING OPTIONS
Options can be combined if they do not conflict. Either group the letters Options can be combined if they do not conflict. Either group the letters
together or separate them. together or separate them.
@ -752,7 +755,7 @@ like \fB\-M\fR or \fB\-B\fR.
Force inxi to use [curl|fetch|perl|wget] for downloads. Force inxi to use [curl|fetch|perl|wget] for downloads.
.TP .TP
.B \-\-hostname\fR .B \-\-host\fR
Turns on hostname in System line. Overrides inxi config file value (if set): Turns on hostname in System line. Overrides inxi config file value (if set):
\fBSHOW_HOST='false'\fR \fBSHOW_HOST='false'\fR
@ -775,7 +778,7 @@ Updates / installs man page with \fB\-U\fR if pinxi or using \fB\-U 3\fR dev bra
(Only active if \fB\-U\fR is is not disabled by maintainers). (Only active if \fB\-U\fR is is not disabled by maintainers).
.TP .TP
.B \-\-no\-hostname\fR .B \-\-no\-host\fR
Turns off hostname in System line. Useful, with \fB\-z\fR, for anonymizing your Turns off hostname in System line. Useful, with \fB\-z\fR, for anonymizing your
inxi output for posting on forums or IRC. Same as configuration value: inxi output for posting on forums or IRC. Same as configuration value:
@ -817,13 +820,12 @@ Overrides default internal value and user configuraton value:
.SH DEBUGGING OPTIONS .SH DEBUGGING OPTIONS
.TP .TP
.B \-\-dbg [1\-x]\fR .B \-\-dbg [1\-x]\fR
Triggers specific debug actions for testing purposes only. See: \fBDevelopers only!\fR Triggers specific debug actions for testing purposes only. See
the documentation file for the active debugger options. These change depending on debug
requirements, so there's no point in listing those options here in the man page.
\fIhttps://github.com/smxi/inxi/docs/inxi-values.txt\fR \fIhttps://github.com/smxi/inxi/docs/inxi-values.txt\fR
For the active debugger options. These change depending on debug requirements,
so there's no point in listing those options here in the man page.
.TP .TP
.B \-\-debug [20\-22]\fR .B \-\-debug [20\-22]\fR
Debugger output generator. Debugger output generator.

View file

@ -1,3 +1,27 @@
=====================================================================================
Version: 2.9.08
Patch Version: 00
Script Date: 2018-03-26
-----------------------------------
Changes:
-----------------------------------
New version, new man page. Bug fixes, feature/output tweaks.
Bugs fixed:
1. stray undefined value corrected
2. fixed BSD no pkg server case, now shows correctly that no pkg server files
were found, not that the OS is not supported.
Features:
1. -t c and m headers cleaned up and simplified
2. man page edits.
3. more standarization of key names for fields, some spelling
and upper/lower case corrections.
-----------------------------------
-- Harald Hope - Mon, 26 Mar 2018 14:59:11 -0700
===================================================================================== =====================================================================================
Version: 2.9.07 Version: 2.9.07
Patch Version: 00 Patch Version: 00