Replies: 2 comments 5 replies
-
Wow, that is a complex scenario. I don't even know if I would consider it a bug, more a scenario beyond those envisioned. The text generated in the warnings is in the order of check definitions, I don't think it was anticipated that the order would be otherwise, though that is something that maybe should be resolved to take into account the application_index if appropriate. But that is not currently done. As far as the partial defaults I am going to have to dig into what the code is doing in that scenario, I think it treats a tuple as a single object and would initialize the optional parts with whatever an empty string converts to, which is the correct thing to do in all previously encountered cases. I will look into whether partial default is a practical possibility. |
Beta Was this translation helpful? Give feedback.
-
I suspect the only way to handle the partial default at present would be a custom callback for that option to do the conversion directly with a string vector of the arguments. |
Beta Was this translation helpful? Give feedback.
-
I'm trying to create an option is bound to the following variable:
tuple<string,string,int,string> remap_args{"angularmap","angularmap",1,"bilinear"};
I have two problems.
env_format_names
andlookup_mode_names
are sets with the allowed strings),Then the arguments listed in CLI11's error string are out of order. It gives the following error (note that POSITIVE is listed in index 1 instead of 2:
--remap: 4 required [TEXT,TEXT,INT,TEXT]:{angularmap,cubemap,cylindrical,latlong,mirrorball}:POSITIVE:{angularmap,cubemap,cylindrical,latlong,mirrorball}:{bicubic,bilinear,nearest} missing
I can get it to correctly order these through trial and error by changing the order of the chained validators to:
This then produces the argument descriptions in the right order upon error:
--remap: 4 required [TEXT,TEXT,INT,TEXT]:{angularmap,cubemap,cylindrical,latlong,mirrorball}:{angularmap,cubemap,cylindrical,latlong,mirrorball}:POSITIVE:{bicubic,bilinear,nearest} missing
Is this a bug? Am I doing something wrong?
->type_size(2,4)
i can make CLI11 accept 2,3 or 4 arguments to this option:Unfortunately, when if I pass in less than 4 arguments, the last two arguments do not retain the default values specified in the bound variable.
Is there a correct way to achieve this?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions