octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #50752] inputParser Parameter key are parsed a


From: Carnë Draug
Subject: [Octave-bug-tracker] [bug #50752] inputParser Parameter key are parsed as Optional
Date: Sun, 9 Apr 2017 12:54:31 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0

Follow-up Comment #5, bug #50752 (project octave):

Well, Matlab compatibility seems to make it impossible to have
positional options whose value is a parameter key.  I pushed this
change which adds those tests and also works for Switch options:

http://hg.savannah.gnu.org/hgweb/octave/rev/f1bf2590272a

Can someone with Matlab tell us how it behaves in the following cases?

+verbatim-+
%% Does this errors about missing value for parameter line?
p = inputParser ();
p.addOptional ('op1', 'val1');
p.addParameter ('line', 'circle');
p.parse ('line');
p.Results ()



%% Does this error about invalid argument for line? Or does it
%% backtracks and retests it as values for op1 and op2?
p = inputParser ();
p.addOptional ('op1', 'val1');
p.addOptional ('op2', 'val2');
p.addParameter ('line', 'circle', @ischar);
p.parse ('line', 89);
p.Results ()




%% If there's enough arguments to fill the positional options and
param/key, does it do it?
p = inputParser ();
p.addOptional ('op1', 'val1');
p.addOptional ('op2', 'val2');
p.addParameter ('line', 'tree');
p.parse ('line', 'circle', 'line', 'rectangle');
p.Results ()



    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?50752>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]