[Tkabber-dev] [tclgpg] r66 committed - Make [unset] check the number of arguments...

codesite-noreply at google.com codesite-noreply at google.com
Thu Aug 20 18:36:32 MSD 2009


Revision: 66
Author: khomoutov
Date: Thu Aug 20 07:36:01 2009
Log: Make [unset] check the number of arguments

Now the [unset] command checks to see if it
is passed exactly two parameters and returns
and error if this is not true.

http://code.google.com/p/tclgpg/source/detail?r=66

Modified:
  /trunk/ChangeLog
  /trunk/tclgpg.tcl
  /trunk/tclgpg.test

=======================================
--- /trunk/ChangeLog	Thu Aug 20 05:05:14 2009
+++ /trunk/ChangeLog	Thu Aug 20 07:36:01 2009
@@ -10,6 +10,10 @@

  	* doc/gpg.man: Enclosed section heading in quotes.

+	* tclgpg.tcl: [unset] command now checks if its
+	  the number of arguments it is passed and
+	  returns an error if it is wrong.
+
  2009-08-16  Sergei Golovan  <sgolovan at nes.ru>

  	* tclgpg.tcl: Moved error generating code to a separate procedure.
=======================================
--- /trunk/tclgpg.tcl	Sun Aug 16 11:51:30 2009
+++ /trunk/tclgpg.tcl	Thu Aug 20 07:36:01 2009
@@ -278,6 +278,11 @@

      Debug 2 "$token $args"

+    if {[llength $args] != 2} {
+        return -code error \
+            "wrong # args: should be unset -property propertyName"
+    }
+
      foreach {key val} $args {
          switch -- $key {
              -property { set prop $val }
=======================================
--- /trunk/tclgpg.test	Thu Aug 20 04:57:20 2009
+++ /trunk/tclgpg.test	Thu Aug 20 07:36:01 2009
@@ -156,8 +156,7 @@
      set c [::gpg::new]
      $c unset
  } -returnCodes error \
-    -result {missing property: must be armor, textmode,\
-        passphrase-callback, signers, encoding, or passphrase-encoding} \
+    -result {wrong # args: should be unset -property propertyName} \
      -cleanup {$c free}

  test unset-1.8 {Unset with an incorrect option} -body {


More information about the Tkabber-dev mailing list