add JID search support

This commit is contained in:
Zane C. B-H 2019-08-22 22:19:02 -05:00
parent 4b176a2d70
commit 776d25c0db
1 changed files with 20 additions and 1 deletions

View File

@ -27,6 +27,8 @@ sub help{
-F Show major faults.
-J Show jail IDs.
-j <jids> A comma seperated list of JIDs to search for.
--ji Invert the JIDs earch.
-n Show number of threads.
@ -90,6 +92,8 @@ my $cmajor_faults=0;
my $numthr=0;
my $tty=0;
my $jid=0;
my $jids_string;
my $jids_invert=0;
# get the commandline options
Getopt::Long::Configure ('no_ignore_case');
@ -126,6 +130,8 @@ GetOptions(
'tty' => \$tty,
'J' => \$jid,
'nc' => \$no_color,
'j=s' => \$jids_string,
'ji' => \$jids_invert,
);
# print the version info if requested
@ -237,6 +243,20 @@ if ( defined( $rss_string ) ){
});
}
#
# handles the JID search
#
if ( defined( $jids_string ) ){
my @jids=split(/\,/, $jids_string );
push( @filters, {
type=>'JID',
invert=>$jids_invert,
args=>{
jids=>\@jids,
},
});
}
#
# handles the time search
#
@ -286,7 +306,6 @@ if ( $no_color ){
$ENV{ANSI_COLORS_DISABLED}=1;
}
#
# handles the time search
#