HomeClusterLabs Projects

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

Unpublished Commit ยท Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.
This commit no longer exists in the repository. It may have been part of a branch which was deleted.This commit has been deleted in the repository: it is no longer reachable from any branch, tag, or 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

Event Timeline

Commit No Longer Exists

This commit no longer exists in the repository.