Skip to content
Snippets Groups Projects
Commit 2003b322 authored by Michal Svamberg's avatar Michal Svamberg
Browse files

Remove old_perl/ directory

parent f40d7801
Branches
No related tags found
No related merge requests found
Pipeline #5315 passed
#!/usr/bin/perl
use warnings;
use strict;
use FindBin;
use lib "$FindBin::RealBin/../lib";
use File::Basename qw(basename);
use Getopt::Long ();
use Readonly;
use Log::TraceMessages qw(t d);
use MetaScp::Path;
Readonly my $SCP_META_VERSION => qw(0.0.1);
Readonly my $EXE => basename($0);
my @getoptions = qw(
3
4
6
A
B
C
p
q
r
T
v+
c=s
F=s
i=s
J=s
l=s
o=s
P=i
S=s
h|help
meta_debug
meta_print
);
my %opt;
Getopt::Long::GetOptions(\%opt, @getoptions)
or die "error parsing options\n";
$Log::TraceMessages::On = 1 if $opt{meta_debug}; # enabling debug if you need
my $dst=pop or do { print STDERR "ERROR: Missing source or target option\n"; show_help(); };
my @src=@ARGV or do { print STDERR "ERROR: Missing source or target option\n"; show_help(); };
#t "src=@src\ndst=$dst\nargv=@ARGV" . d(\@src);
sub show_help {
print "scp_meta v$SCP_META_VERSION\n";
print <<"EOT-EOT-EOT";
Syntax: scp_meta [-346ABCpqrTv] [-c cipher] [-F ssh_config] [-i identity_file] [-J destination] [-l limit] [-o ssh_option] [-P port] [-S program] source ... target
This program accept all scp parameters (see 'man scp') and these additional options:
-h --help print this help
--meta_debug enable debug mode for this program (not for scp/cp)
--meta_print do not run command, only print it to the STDOUT
EOT-EOT-EOT
exit 0;
}
exit 0
#!/usr/bin/perl
Package Metascp;
Package MetaScp::Path;
sub new {
my $self = bless {}, shift;
$self->{path_user} = shift;
$self->{user} = "";
$self->{server} = "";
$self->{port} = "";
$self->{path} = $self->_expand_path();
return $self;
}
sub _decouple_path {
$self->{path_user} =~ //;
}
sub _expand_path {
# je tedy relativni => pridat pracovni adresar
my $new_path = $self->_normalize_path($self->{path_user});
return 1;
}
sub _normalize_path {
# kontrola, zda cesta neni relativni, jinak pridat pracovni adresar
my $path = shift;
# cesta muze byt zadana ve formatu [user@]server:<cesta>
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment