# NOTE: Derived from lib/Zoidberg/Fish/Intel.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Zoidberg::Fish::Intel;

#line 453 "lib/Zoidberg/Fish/Intel.pm (autosplit into blib/lib/auto/Zoidberg/Fish/Intel/i_cmd_man.al)"
sub i_cmd_man {
	my ($self, $block) = @_;
	return $block, 'files' if $$block[-1] =~ m#/#;
	my @manpath = split /:/, $ENV{MANPATH}; # in the environemnt we trust
	my $section = $$block[-2] if @$block > 3;
	my @pages;
	for my $mdir (@manpath) {
		next unless -d $mdir;
		my @sect = list_dir($mdir);
		@sect = grep /\Q$section\E/, @sect if $section;
		for (@sect) {
			my $dir = "$mdir/$_";
			next unless -d $dir;
			push @pages,
				map  { s/\..*$//; $_ }
				grep /^\Q$$block[-1]\E/, list_dir($dir);
		}
	}
	$$block[0]{poss} = [sort @pages];
	return $block;
}

1;
# end of Zoidberg::Fish::Intel::i_cmd_man
