File: dump-object.pl

package info (click to toggle)
libnet-dbus-perl 1.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 720 kB
  • sloc: perl: 4,919; sh: 34; makefile: 6
file content (26 lines) | stat: -rw-r--r-- 419 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/perl

use warnings;
use strict;

use Net::DBus;
use Net::DBus::Dumper;
use Carp qw(confess);

$SIG{__DIE__} = sub {confess $_[0] };

my $bus = Net::DBus->find;

if (@ARGV) {
    my $service = $bus->get_service(shift @ARGV);
    
    if (@ARGV) {
	my $object = $service->get_object(shift @ARGV);
	print dbus_dump($object);
    } else {
	print dbus_dump($service);
    }
} else {
    print dbus_dump($bus);
}