HomeClusterLabs Projects

Refactor: libcrmcommon: Add pcmk__build_arg_context.

Description

Refactor: libcrmcommon: Add pcmk__build_arg_context.

This function constructs a GOptionContext with a very basic set of
options in the main group that all command line tools should support.
This includes the formatted output options. It is expected this
function will only be called once by a tool. Calling it twice will lead
to problems.

This patch also introduces a new pcmkcommon_args_t type. This type is
to prevent the number of arguments to pcmk
build_arg_context to a
minimum and allows hiding certain implementation details. For instance,
glib doesn't have a good way of returning how many times an option was
used so we have to use a callback for that. This can be hidden and the
result just stored in the new type.

Details

Provenance
clumensAuthored on Jun 25 2019, 1:53 PM
Parents
rP353f70059610: Refactor: libcrmcommon: Add an easier way to register formats.
Branches
Unknown
Tags
Unknown

Event Timeline