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

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

[Octave-bug-tracker] [bug #62639] inputParser fails to recognize Optiona


From: anonymous
Subject: [Octave-bug-tracker] [bug #62639] inputParser fails to recognize Optional parameter with argument
Date: Wed, 6 Jul 2022 06:51:09 -0400 (EDT)

Follow-up Comment #11, bug #62639 (project octave):

OP here.

In terms of inputParser, 'Optional' are positional parameters that are not
mandatory to pass, while the 'Parameter' are named parameters, that you should
first pass the name of parameter and then the value.

In your first example

p.addParameter('opt',{});
p.parse('opt', 'xxx')

'opt' is the name, and 'xxx' is the argument.

In second example:

p.addOptional('opt',{});
p.parse('opt', 'xxx')

'opt' is the argument, and following one 'xxx' is not defined.

In Matlab, however if first argument has name of one of the options, then it
tries to interpret it as parameter and not option.

I hope it make the issue clearer.

>From user point of view, change Options to Parameters require little effort.
Not sure if replicate this behavior in Octave is necessary.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?62639>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

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