Added ghost option for compression, currently not working. Perltidy.
authorFlavio Poletti <flavio@polettix.it>
Fri, 8 Aug 2008 17:47:35 +0000 (8 19:47 +0200)
committerFlavio Poletti <flavio@polettix.it>
Fri, 8 Aug 2008 17:47:35 +0000 (8 19:47 +0200)
deploy

diff --git a/deploy b/deploy
index ae711e2..3c46558 100755 (executable)
--- a/deploy
+++ b/deploy
@@ -23,15 +23,16 @@ my %config = (
 GetOptions(
    \%config,
    qw(
-      usage! help! man! version!
-
-      debug|D!
-      dir|directory|d=s 
-      password|pass|p:s 
-      prompt|P!
-      script|s=s
-      username|user|u=s
-   )
+     usage! help! man! version!
+
+     compress|c!
+     debug|D!
+     dir|directory|d=s
+     password|pass|p:s
+     prompt|P!
+     script|s=s
+     username|user|u=s
+     )
 );
 pod2usage(message => "$0 $VERSION", -verbose => 99, -sections => ' ')
   if $config{version};
@@ -109,7 +110,7 @@ sub get_ssh {
    my $ssh = Net::SSH::Perl->new(
       $hostname,
       protocol => 2,
-      debug    => $config{debug}
+      debug    => $config{debug},
    );
    $ssh->login($config{username}, $config{password}, 'suppress_shell');
 
@@ -120,12 +121,13 @@ sub get_sftp {
    my ($hostname) = @_;
    return Net::SFTP->new(
       $hostname,
-      warn => sub { },
-      user => $config{username},
+      warn     => sub { },
+      user     => $config{username},
       password => $config{password},
       ssh_args => {
-         protocol => 2,
-         debug => $config{debug},
+         protocol    => 2,
+         debug       => $config{debug},
+         compression => $config{compress},
       }
    );
 } ## end sub get_sftp