diff mbox

[4/4] test: Add option to deactivate tag

Message ID 20170616035728.19415-5-mgreer@animalcreek.com (mailing list archive)
State Accepted
Delegated to: Samuel Ortiz
Headers show

Commit Message

Mark Greer June 16, 2017, 3:57 a.m. UTC
Add the 'deactivate' option to test-tag which deactivates the
specified tag.

Signed-off-by: Mark Greer <mgreer@animalcreek.com>
---
 test/test-tag | 13 +++++++++++++
 1 file changed, 13 insertions(+)
diff mbox

Patch

diff --git a/test/test-tag b/test/test-tag
index fd80132..cb2c9e8 100755
--- a/test/test-tag
+++ b/test/test-tag
@@ -11,6 +11,7 @@  def usage():
 	text = """
 list
 dump <tag>
+deactivate <tag>
 write <tag> <type> <...>
 
 	If type is Text, parameters are <encoding> <language> <representation>
@@ -165,5 +166,17 @@  if (sys.argv[1] == "write"):
 	else:
 		usage()
 
+	sys.exit(0)
+
+if (sys.argv[1] == "deactivate"):
+	print sys.argv[2]
+	if (len(sys.argv) != 2):
+		tag = neardutils.find_tag(sys.argv[2])
+		tag.Deactivate()
+	else:
+		usage()
+
+	sys.exit(0)
+
 else:
 	usage()