| Summary | Included libraries | Package variables | Description | General documentation | Methods |
G::Shell::Help - G-language Shell helper module for command references
This class is a part of G-language Genome Analysis Environment, providing functions for "help" features of the G-language Shell.
| buildHelpDB | No description | Code |
| help | Description | Code |
| process_bp | No description | Code |
| process_g | No description | Code |
| help | code | next | Top |
Name: help - G-language Shell help command
Description:
G-language Shell help command. This command seaches through
G-language GAE manual to show the corresponding entries for a given keyword.
You can also search through the documentation with options (See below).
Usage:
help |
| buildHelpDB | description | prev | next | Top |
require G::IO; my $gv = $G::IO::VERSION; if(sdb_exists("pdoc-g$gv") && sdb_exists("gclass-$gv")){ %pdoc = %{sdb_load("pdoc-g$gv")}; %gclass = %{sdb_load("gclass-$gv")}; return; } my $gPath = qx//perldoc -l G::IO/;}
my $rcmdPath = qx//perldoc -l Rcmd::Clustering/;
$gPath =~ s/\/IO.pm//; $rcmdPath =~ s/\/Clustering.pm//; chomp($gPath); chomp($rcmdPath); find({"wanted"=>\&process_g, 'follow'=>1}, $gPath . '.pm'); find({"wanted"=>\&process_g, 'follow'=>1}, $gPath); find({"wanted"=>\&process_g, 'follow'=>1}, $rcmdPath . '.pm'); find({"wanted"=>\&process_g, 'follow'=>1}, $rcmdPath); sdb_save(\%pdoc, "pdoc-g$gv"); sdb_save(\%gclass, "gclass-$gv");
| help | description | prev | next | Top |
buildHelpDB() unless(scalar %pdoc); my $key = shift || 'help'; if ($key =~ /^\-(\S+)/){ my $option = $1; $key = join(' ', @_); my $lckey = lc($key); my $ans = " Keyword\" $key\" was not found in the documentations.\n"; my @tmp; foreach my $keyword (sort keys %pdoc){ if(lc($pdoc{$keyword}) =~ /$lckey/){ push(@tmp, $keyword); }elsif(length($lckey) < 1){ push(@tmp, $keyword); } if(scalar(@tmp)){ $ans = sprintf(" Found keyword\" %s\" in the following manual pages\( %s hits\).\n\n", $key, scalar(@tmp)); foreach my $entry (@tmp){ my $tmp = $pdoc{$entry}; my $abstract; if($tmp =~ /Name:\s*(.*)( - .*?)\_\_\%\%\%\%\%\_\_/){ $abstract = $2; } if($entry){ $ans .= sprintf(" %-32s%s\n",$entry, $abstract); } } } } msg_send($ans); return $ans; }else{ my $ans = $pdoc{$key}; my $ans2 = $pdoc{'$gb->' . $key . '()'}; if(length $ans){ $ans =~ s/\_\_\%\%\%\%\%\_\_/\n/g; unless($ans =~ /Name: (.*) - (.*)\n/){ $ans = "\n Name: $key\n". $ans; } }elsif(length $ans2){ $ans = $ans2; $ans =~ s/\_\_\%\%\%\%\%\_\_/\n/g; unless($ans =~ /Name: (.*) - (.*)\n/){ $ans = "\n Name: $key\n". $ans; } }else{ $ans = " Keyword:\" $key\" not found in manual.\n\n"; my $lckey = lc($key); my @tmp;; foreach my $keyword (sort keys %pdoc){ if(lc($keyword) =~ /$lckey/){ push(@tmp, $keyword); if(lc($keyword) eq $lckey){ $ans = $pdoc{$keyword}; $ans =~ s/\_\_\%\%\%\%\%\_\_/\n/g; unless($ans =~ /Name: (.*) - (.*)\n/){ $ans = "\n Name: $key\n". $ans; } msg_send($ans); return $ans; } } } unless(scalar(@tmp)){ foreach my $keyword (sort keys %pdoc){ if(amatch($lckey, ['i 1'], lc($keyword))){ push(@tmp, $keyword); } } } if(scalar(@tmp)){ $ans .= " Did you mean:\n"; foreach my $entry (@tmp){ $ans .= " " . $entry . "\n"; } } $ans .= "\n\n use\" help -s\" if you want to search, or\" help help\" if desperate.\n"; } msg_send($ans); return $ans; }}
| process_bp | description | prev | next | Top |
#this process is deprecated.}
my $class = 'Bio'; if ($File::Find::name =~ /\/(Bio.*)\.pm$/){ $class = $1; $class =~ s/\//::/g; }else{ next; } open(FILE, $File::Find::name) || die($!); while(<FILE>){ chomp; if(/^\s*\=head2\s+(\S*)\s*/){ my $subname = $class . '::' . $1; next if ($subname =~ /Mailing Lists/ || $subname =~ /Reporting Bugs/); while(<FILE>){ chomp; last if (/\=cut/); $pdoc{$subname} .= $_ . '__%%%%%__'; } } } close(FILE);
| process_g | description | prev | next | Top |
next unless(/\.pm$/); my $class = 'G'; if ($File::Find::name =~ /\/((?:G|SubOpt|Rcmd).*)\.pm$/){ $class = $1; $class =~ s/\//::/g; }else{ next; } open(FILE, $File::Find::name) || die($File::Find::name, " ", $!); while(<FILE>){ chomp; if(/^\s*\=head2\s+(.*)\s*$/){ my $subname = $1; $gclass{$subname} = $class; while(<FILE>){ chomp; last if (/\=cut/); $pdoc{$subname} .= $_ . '__%%%%%__'; } } } close(FILE);}