From caf3ac3de1848814554282370069dfdda820884c Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Thu, 20 Jun 2013 14:39:11 +0200 Subject: [PATCH] test: Check for dump-* scripts argument Check that there at least is one argument and dump a usage example otherwise. --- test/dump-device | 4 ++++ test/dump-record | 4 ++++ test/dump-tag | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/test/dump-device b/test/dump-device index 58b090c..6eead93 100755 --- a/test/dump-device +++ b/test/dump-device @@ -3,6 +3,10 @@ import sys import dbus +if len(sys.argv) < 2: + print "Usage: %s /org/neard/nfcX" % (sys.argv[0]) + sys.exit(1) + bus = dbus.SystemBus() def extract_record(key, list): diff --git a/test/dump-record b/test/dump-record index 2b7c187..b4db2af 100755 --- a/test/dump-record +++ b/test/dump-record @@ -3,6 +3,10 @@ import sys import dbus +if len(sys.argv) < 2: + print "Usage: %s /org/neard/nfcN/tagT/recordR" % (sys.argv[0]) + sys.exit(1) + def extract_list(list): val = "[" for i in list: diff --git a/test/dump-tag b/test/dump-tag index efdd14f..01652ea 100755 --- a/test/dump-tag +++ b/test/dump-tag @@ -3,6 +3,10 @@ import sys import dbus +if len(sys.argv) < 2: + print "Usage: %s /org/neard/nfcN/tagT" % (sys.argv[0]) + sys.exit(1) + bus = dbus.SystemBus() def extract_list(list): -- 2.7.4