Matt Spinler | 716262f | 2019-04-09 13:02:12 -0500 | [diff] [blame] | 1 | #! /usr/bin/perl |
| 2 | |
| 3 | use strict; |
| 4 | use warnings; |
| 5 | use mrw::Targets; |
| 6 | use mrw::Inventory; |
| 7 | |
| 8 | my $targetObj; |
| 9 | my $serverwizFile = $ARGV[0]; |
| 10 | if ((not defined $serverwizFile) || (! -e $serverwizFile)) { |
| 11 | die "Usage: $0 [XML filename]\n"; |
| 12 | } |
| 13 | |
| 14 | $targetObj = Targets->new; |
| 15 | $targetObj->loadXML($serverwizFile); |
| 16 | |
| 17 | my @inventory = Inventory::getInventory($targetObj); |
| 18 | |
| 19 | for my $item (@inventory) { |
| 20 | print "---------------------------------------------------------------\n"; |
| 21 | print "Target: $item->{TARGET}\n"; |
| 22 | print "Name: $item->{OBMC_NAME}\n"; |
| 23 | } |