On 01/05/2010 12:17 PM, Jean-Marc Lasgouttes wrote:
[email protected] writes:

Author: rgheck
Date: Tue Jan  5 16:01:32 2010
New Revision: 32770
URL: http://www.lyx.org/trac/changeset/32770

Log:
Kill warning: string::npos was the wrong type, and does not reflect what
max is supposed to be.

JMarc: I assume you are intending to use this new method, getLongArg()?
Yes, in my inset-forall patch. In the long term, I think these argument
parsing methods are enough for all our lfun parsing needs. This means
that we could declare arguments to an lfun as "ssl" and have FuncRequest
provide us with two space-delimited _s_hort arguments and put the
remainder of the line in the third _l_ong argument.

Since only the last argument can be long, I would think, it would be enough to specify the number of arguments. And since, in practice, you only really need to know how many arguments are expected if one of them is long, then it would only have to be specified in cases where you want to allow that. Yes?

Moreover, since the number of arguments expected is presumably determined by the LFUN, we could add this info to LyXAction.cpp, where it is required (i.e., where there is a possibility of long arguments.

If that is right, then we can replace FuncRequest::getArg(int) with FuncRequest::getArgs(), returning a vector<string>, and then figure out how many args we're supposed to return from what we add to LyXAction.cpp.

Sound reasonable? Or did I go wrong somewhere?

rh


Reply via email to