libelektra
libelektra copied to clipboard
Clarify when/if to use elektraGetOpts
How would using gopts help with making it work properly?
There is already one reason above (externally accessible spec). Other reasons are:
- IIRC
elektraGetOptsdoes not considermeta:/defaultat all. elektraGetOptsdefinitely doesn't handle any other spec like e.g.meta:/type- AFAIK
kdb's profile feature can be used to set default arguments within the KDB. That would automatically be handled correctly withgopts, since it would load theproc:/keys at the right moment for all spec validation to work correctly (at least onnew-backendit will) and a cascading lookup would return the correct key for everything.
Originally posted by @kodebach in https://github.com/ElektraInitiative/libelektra/issues/4438#issuecomment-1222282087
I think this should be clearly stated in the docu of elektraGetOpts. Otherwise people might use elektraGetOpts "by accident" as they might not know about gopts.
@kodebach can you take this issue?
The tutorial for command line options already recommends gopts and only briefly explains how to use elektraGetOpts. It also explains the downsides of doing so. The doxygen comment of elektraGetOpts does not directly mention gopts, but it refers to the tutorial.
What exactly should we improve here? IMO this is again more of a discoverability issue not an issue with actual docs content.
The doxygen comment of elektraGetOpts does not directly mention gopts
This should be changed. It should recommend to use gopts, with the reasons you outlined.
IMO this is again more of a discoverability issue not an issue with actual docs content.
Yes, it is a discoverability issue, thus it should be mentioned in elektraGetOpts. We should also mention it in the dev guide for application developers #4436.
I mark this stale as it did not have any activity for one year. I'll close it in two weeks if no further activity occurs. If you want it to be alive again, ping by writing a message here or create a new issue with the remainder of this issue. Thank you for your contributions :sparkling_heart:
I closed this now because it has been inactive for more than one year. If I closed it by mistake, please do not hesitate to reopen it or create a new issue with the remainder of this issue. Thank you for your contributions :sparkling_heart: