HomeClusterLabs Projects

Feature: tools: Convert command line handling in stonith_admin.

Description

Feature: tools: Convert command line handling in stonith_admin.

This fairly large patch changes stonith_admin to use glib for its command
line argument processing. It doesn't seem easy to try to split this up
into smaller patches, but luckily it's not doing anything tricky.

Important changes in this patch are:

  • The options themselves have been converted to GOptionEntries and then

grouped together into GOptionGroups. This allows for more condensed
top-level help output, plus --help-<topic> options.

  • There is now a large block of global variables at the top of the file,

replacing a large block of variables in main. This is due to how glib
works - each GOptionEntry wants a variable where it writes the setting.

  • Argument processing now happens as a one-off function call instead of

in a loop. After this single call, a separate set of argument processing
occurs where what glib did is inspected and additional flags are set.

Details

Provenance
clumensAuthored on Jun 27 2019, 10:27 AM
Parents
rPa7b810762ff3: Refactor: libcrmcommon: Add pcmk__build_arg_context.
Branches
Unknown
Tags
Unknown

Event Timeline