# HG changeset patch # User Heiko Schlittermann (JUMPER) # Date 1304088216 -7200 # Node ID fcb7cefb7be7b9a64c02099acb6274d616e46429 # Parent 09f5c71b3a76c60beec70fc5e38a9600172ae4cc [perltidy] diff -r 09f5c71b3a76 -r fcb7cefb7be7 ftpipe --- a/ftpipe Fri Apr 29 16:42:55 2011 +0200 +++ b/ftpipe Fri Apr 29 16:43:36 2011 +0200 @@ -19,10 +19,11 @@ MAIN: { GetOptions( - "p|put!" => sub { $opt_cmd = "put" }, - "g|get!" => sub { $opt_cmd = "get" }, - "l|ls!" => sub { $opt_cmd = "ls" }, - "d|L|ll|dir!" => sub { $opt_cmd = "dir" }, + "p|put!" => sub { $opt_cmd = "put" }, + "g|get!" => sub { $opt_cmd = "get" }, + "l|ls!" => sub { $opt_cmd = "ls" }, + "d|L|ll|dir!" => sub { $opt_cmd = "dir" }, + #"r|rm!" => "debug!" => \$opt_debug, "h|help" => sub { pod2usage(-verbose => 1, -exit => 0) }, @@ -35,8 +36,9 @@ ### %ftp die "need hostname" if not defined $ftp{host}; - die "need filename" if not defined $ftp{file} - and $opt_cmd ~~ [qw(put get)]; + die "need filename" + if not defined $ftp{file} + and $opt_cmd ~~ [qw(put get)]; my $ftp = new FTP($ftp{host}, Debug => $opt_debug, Passive => 1); $ftp->login($ftp{user}, $ftp{pass}); @@ -46,9 +48,9 @@ given ($opt_cmd) { when ("put") { $ftp->put(*STDIN, $ftp{file}) } when ("get") { $ftp->get($ftp{file}, *STDOUT) } - when ("ls") { say join "\n", sort $ftp->ls }; - when ("dir") { say join "\n", sort $ftp->dir }; - default { pod2usage }; + when ("ls") { say join "\n", sort $ftp->ls }; + when ("dir") { say join "\n", sort $ftp->dir }; + default { pod2usage }; } exit;