Skip to content

Document/guard no-newline limitations for text/code output #161

@kantord

Description

@kantord

Summary

--no-newline currently only has an effect for structured templates (JSON/YAML). In text/code modes the renderer always emits line-oriented output with a trailing newline, so the flag silently does nothing. The CLI help/README don’t mention this limitation, which can confuse users.

Steps to Reproduce

  1. Run headson --no-newline -f text tests/fixtures/code/sample.py.
  2. Observe that the output still ends with a newline and spans multiple lines.

Expected Behavior

Documentation (and ideally the CLI) should state that --no-newline only applies to structured formats. When the flag is used with text/code output, the tool should warn the user or explicitly ignore it.

Proposed Fix

  • Update the README and --help text to note that --no-newline is only honored for JSON/YAML-family templates.
  • Consider emitting a warning when --no-newline is combined with -f text, -f code, or --format auto that resolves to those modes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions