]> git.donarmstrong.com Git - biopieces.git/commitdiff
added list_mysql_databases
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Mon, 27 Jul 2009 10:47:37 +0000 (10:47 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Mon, 27 Jul 2009 10:47:37 +0000 (10:47 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@597 74ccb610-7750-0410-82ae-013aeee3265d

bp_bin/list_mysql_databases [new file with mode: 0755]
code_perl/Maasha/Biopieces.pm

diff --git a/bp_bin/list_mysql_databases b/bp_bin/list_mysql_databases
new file mode 100755 (executable)
index 0000000..5c34482
--- /dev/null
@@ -0,0 +1,74 @@
+#!/usr/bin/env perl
+
+# Copyright (C) 2007-2009 Martin A. Hansen.
+
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+# http://www.gnu.org/copyleft/gpl.html
+
+
+# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> DESCRIPTION <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+# Display all MySQL databases.
+
+# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+
+use warnings;
+use strict;
+use Maasha::Common;
+use Maasha::Biopieces;
+use Maasha::SQL;
+
+
+# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+
+my ( $options, $user, $password, @databases, $database );
+
+$user     = $ENV{ "USER" };
+$password = $ENV{ "USER" };
+
+$options = Maasha::Biopieces::parse_options(
+    [
+        { long => 'user',     short => 'i', type => 'string', mandatory => 'no', default => $user,     allowed => undef, disallowed => undef },
+        { long => 'password', short => 'n', type => 'string', mandatory => 'no', default => $password, allowed => undef, disallowed => undef },
+    ]   
+);
+
+@databases = Maasha::SQL::list_databases( $options->{ 'user' }, $options->{ 'password' } );
+
+map { Maasha::Biopieces::put_record( { 'DATABASE' => $_ } ) } @databases;
+
+
+# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+
+BEGIN
+{
+    Maasha::Biopieces::status_set();
+}
+
+
+END
+{
+    Maasha::Biopieces::status_log();
+}
+
+
+# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+
+__END__
index 61dfdf27e5a29ccc45eadeed1349ec664b3f9236..20e1083db3e52b6ba93349c9f114c7dcc0ee546e 100644 (file)
@@ -413,7 +413,7 @@ sub check_print_usage
                
                     if ( exists $options->{ 'help' } ) {
                         `print_wiki --data_in=$wiki --help`;
-                    } elsif ( $script =~ /^(list_biopieces|list_genomes|biostat)$/ ) {
+                    } elsif ( $script =~ /^(list_biopieces|list_genomes|list_mysql_databases|biostat)$/ ) {
                         return;
                     } else {
                         `print_wiki --data_in=$wiki`;