mirror of
https://github.com/duncs/clusterssh.git
synced 2025-07-03 18:03:23 +00:00
45 lines
815 B
Perl
Executable file
45 lines
815 B
Perl
Executable file
#!/usr/bin/perl
|
|
#
|
|
# test script for proving external command for fetching tags works
|
|
#
|
|
use strict;
|
|
use warnings;
|
|
use Getopt::Std;
|
|
|
|
my $opt = {};
|
|
getopts('qx', $opt);
|
|
|
|
# if we get '-q' option, force an error
|
|
if($opt->{q}) {
|
|
my $fail;
|
|
$fail->cause_death();
|
|
}
|
|
|
|
# if we get '-x' option, die with non-0 return code
|
|
if($opt->{x}) {
|
|
warn 'Forced non-0 exit',$/;
|
|
exit 5;
|
|
}
|
|
|
|
my %tag_lookup = (
|
|
tag100 => [ qw/ host100 / ],
|
|
tag200 => [ qw/ host200 host210 host205 / ],
|
|
tag300 => [ qw/ host300 host350 host325 /],
|
|
tag400 => [ qw/ tag100 tag200 tag300 host400 host401 / ],
|
|
);
|
|
|
|
|
|
my @lookup=@ARGV;
|
|
|
|
for (@lookup) {
|
|
if($tag_lookup{$_}) {
|
|
push(@lookup, @{ $tag_lookup{$_} });
|
|
$_= '';
|
|
}
|
|
}
|
|
|
|
@lookup = grep { $_ !~ m/^$/ } sort @lookup;
|
|
|
|
if(@lookup) {
|
|
print "@lookup",$/;
|
|
}
|