Commit d3e80b46 authored by Admin's avatar Admin
Browse files

example of aliasing of a main::subroutine;

parent 52bc1771
......@@ -32,6 +32,8 @@ my $readyfnlist = \%main::readyfnlist;
my $selectlist = \%main::selectlist;
my $sleepers = \%main::sleepers;
sub devspec2array { goto &main::devspec2array }
# {{{ CommandIOWrite
sub CommandIOWrite :Export {
......@@ -73,7 +75,7 @@ sub CommandGet :Export {
return "Usage: get <name> <type-dependent-options>\n$namedef" if (@a < 1);
my @rets;
for my $sdev (main::devspec2array($a[0], $a[1] && $a[1] eq '?' ? undef : $cl)) {
for my $sdev (devspec2array($a[0], $a[1] && $a[1] eq '?' ? undef : $cl)) {
if (!defined($defs->{$sdev})) {
push @rets, "Please define $sdev first";
next;
......@@ -105,7 +107,7 @@ sub CommandSet :Export {
return "Usage: set <name> <type-dependent-options>\n$namedef" if (@arg < 1);
my @rets;
my @devspecs = main::devspec2array($arg[0],
my @devspecs = devspec2array($arg[0],
$arg[1] && $arg[1] eq '?' ? undef : $cl);
for my $sdev (@devspecs) {
......@@ -305,7 +307,7 @@ sub CommandAttr :Export {
if ($main::featurelevel > 5.9 && !goodReadingName($a1) && $a1 ne "?");
my @rets;
for my $sdev (main::devspec2array($a[0], $a1 && $a1 eq "?" ? undef : $cl)) {
for my $sdev (devspec2array($a[0], $a1 && $a1 eq "?" ? undef : $cl)) {
my $hash = $defs->{$sdev};
my $attrName = $a1;
my $attrVal = (defined($a[2]) ? $a[2] : 1);
......@@ -550,7 +552,7 @@ sub CommandDelete :Export {
return "Usage: delete <name>$namedef\n" if (!$def);
my @rets;
for my $sdev (main::devspec2array($def, $cl)) {
for my $sdev (devspec2array($def, $cl)) {
if (!defined($defs->{$sdev})) {
push @rets, "Please define $sdev first";
next;
......@@ -606,7 +608,7 @@ sub CommandDeleteAttr :Export {
return "Usage: deleteattr <name> [<attrname>]\n$namedef" if (@attr < 1);
for my $sdev (main::devspec2array($attr[0], $cl)) {
for my $sdev (devspec2array($attr[0], $cl)) {
if (!defined($defs->{$sdev})) {
push @rets, "Please define $sdev first";
next;
......@@ -657,7 +659,7 @@ sub CommandDisplayAttr :Export {
return "Usage: displayattr <name> [<attrname>]\n$namedef" if (@a < 1);
my @rets;
my @devspec = main::devspec2array($a[0],$cl);
my @devspec = devspec2array($a[0],$cl);
for my $sdev (@devspec) {
if (!defined($defs->{$sdev})) {
......@@ -705,7 +707,7 @@ sub CommandDeleteReading :Export {
$ntfyHash = {};
my @rets;
for my $sdev (main::devspec2array($a[0],$cl)) {
for my $sdev (devspec2array($a[0],$cl)) {
if (!defined($defs->{$sdev})) {
push @rets, "Please define $sdev first";
next;
......@@ -744,7 +746,7 @@ sub CommandList :Export {
push @list, getPawList($arg);
}
else {
@list = main::devspec2array($arg ? $arg : ".*", $cl);
@list = devspec2array($arg ? $arg : ".*", $cl);
}
for my $d (@list) {
return "No device named $d found" if (!defined($defs->{$d}));
......@@ -779,7 +781,7 @@ sub CommandList :Export {
}
else { # devspecArray
my @arg = split(" ", $param);
my @list = main::devspec2array($arg[0],$cl);
my @list = devspec2array($arg[0],$cl);
if ($arg[1]) {
for my $sdev (@list) { # Show a Hash-Entry or Reading for each device
......@@ -984,7 +986,7 @@ sub CommandSetReading :Export {
my @b = @a; # crazy...
my @rets;
for my $sdev (main::devspec2array($a[0],$cl)) {
for my $sdev (devspec2array($a[0],$cl)) {
if (!defined($defs->{$sdev})) {
push @rets, "Please define $sdev first";
next;
......@@ -1018,7 +1020,7 @@ sub CommandSetstate :Export {
my @rets;
CSS_LOOP1:
for my $sdev (main::devspec2array($a[0],$cl)) {
for my $sdev (devspec2array($a[0],$cl)) {
if (!defined($defs->{$sdev})) {
push @rets, "Please define $sdev first";
next;
......@@ -1154,7 +1156,7 @@ sub CommandTrigger :Export {
$state //= '';
my @rets;
for my $sdev (main::devspec2array($dev,$cl)) {
for my $sdev (devspec2array($dev,$cl)) {
if (!defined($defs->{$sdev})) {
push @rets, "Please define $sdev first";
next;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment