Skip to content

Instantly share code, notes, and snippets.

@earnhardt3rd
Created June 19, 2023 14:03
Show Gist options
  • Select an option

  • Save earnhardt3rd/097b0ad35a7d370c43da20022390b605 to your computer and use it in GitHub Desktop.

Select an option

Save earnhardt3rd/097b0ad35a7d370c43da20022390b605 to your computer and use it in GitHub Desktop.
require 'getopts.pl';
Getopts('m:d:t');
my $MODE = uc($opt_m) || "";
my $DEBUG = $opt_d || 0;
if (defined $opt_t) { my %TEST = &_SHOW_HELP();}
1;
sub _SHOW_HELP {
my $inFile = shift || "";
if (scalar(keys %TOOLHELP) > 0) {
print " ********************\n";
print " ** Available Help **\n";
print " ********************\n";
foreach my $thkey(sort keys %TOOLHELP) {
if ($USER_ACCESS =~ /ADMIN/) {
print " $thkey -h\n";
} else {
print " DEBUG:\$TOOLS{$thkey} = " . $TOOLS{$thkey} . "\n" if $DEBUG > 1;
if (exists($TOOLS{$thkey})) {
my @TA = split(',',$TOOLS{$thkey});
if (scalar(@TA) > 0) {
if (exists($TA[2])) {
if ($USER_ACCESS =~ /$TA[2]/) {
print " $thkey -h\n";
}
}
}
}
}
}
} else {
print " ** There is no Help! **\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment