HomeClusterLabs Projects

Refactor: tools: Use out->err() in crm_diff, and drop prompts
2b3a10d6506aUnpublished

Unpublished Commit ยท Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

Refactor: tools: Use out->err() in crm_diff, and drop prompts

The prompts would only make sense for text output format.

They can't be sent to out->err() because it would show up as an error
when the XML output is finished.

If they're sent to out->info(), they won't be output at all for XML
output format, and stdout can't easily be flushed for text output
without checking the output format explicitly or adding new
functionality to the pcmk__output_t API.

We could continue printing to stderr directly, but I'd rather not.

Besides, the prompts are not user-friendly at all, and I'm not sure who
(if anyone) has ever used them. What they don't tell you is that you
have to press Ctrl+D to mark end of input when you're done. Otherwise it
will keep waiting for more input forever.

I would like to eventually get rid of the --stdin option (deprecating
and hiding it first), unless we can come up with a sane way to get TWO
pieces of XML via stdin. Taking input from stdin makes some amount of
sense when it's one piece.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>

Details

Provenance
nrwahl2Authored on Mar 18 2025, 2:11 AM
Parents
rP23eaae9865e7: Refactor: tools: Add pcmk__output_t scaffolding to crm_diff.c
Branches
Unknown
Tags
Unknown

Event Timeline