changeset 10217:8bc0da89f8ef octave-forge

inputParser: give better error message when skipping Optional for finding a string that does not validate but it was still not a ParamValue key
author carandraug
date Thu, 10 May 2012 18:55:43 +0000
parents 8710ef5d29fa
children b617938af30c
files main/general/inst/@inputParser/subsref.m
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/main/general/inst/@inputParser/subsref.m	Thu May 10 15:00:14 2012 +0000
+++ b/main/general/inst/@inputParser/subsref.m	Thu May 10 18:55:43 2012 +0000
@@ -121,7 +121,6 @@
         error("%sinvalid value for parameter '%s'", inPar.FunctionName, name);
       endif
     else
-      
       inPar.Results.(name) = value;
     endif
   endfor
@@ -159,6 +158,9 @@
       method = "Switch";
     else
       ## then it must be a ParamValue, shift its value
+      if (numel (args) < 1)
+        error ("%sno value found for Parameter '%s'", inPar.FunctionName, key);
+      endif
       [value, args] = shift (args);
       method = "ParamValue";
     endif