Skip to content

Fix --tag help text to match actual behaviour on attribute/text matches - #1

Open
gthb wants to merge 1 commit into
flother:mainfrom
gthb:fix/tag-help-text-attribute-and-text
Open

Fix --tag help text to match actual behaviour on attribute/text matches#1
gthb wants to merge 1 commit into
flother:mainfrom
gthb:fix/tag-help-text-attribute-and-text

Conversation

@gthb

@gthb gthb commented Apr 28, 2026

Copy link
Copy Markdown

What

Bring the --tag flag's --help text in line with the behaviour and the usage docs.

Why

The CLI doc-comment currently says:

No effect on attribute, text, or atomic matches.

But that's only true for atomic results. For attribute and text matches --tag does annotate the output with the parent element's synthetic self-closing tag, which is what the usage docs describe: “For attribute and text matches, the tag is the parent element”, and what integration test no_filename_no_part_with_tag_shows_parent_element_then_value exercises.

The `--tag` flag annotates attribute and text matches with the parent
element's synthetic self-closing tag --- documented in the usage docs
and exercised by the existing `no_filename_no_part_with_tag_shows_parent
_element_then_value` integration test. The CLI doc-comment, however, said
"No effect on attribute, text, or atomic matches", which contradicts both
the docs and the implementation. Only atomic results from XPath functions
like `name()` and `count()` are unaffected.

Bring the help text in line with the docs and the test suite.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant