Skip to content

fix(#120): ensure message handling in journal logging command#121

Merged
GingerGraham merged 2 commits into
mainfrom
fix/issue-120
Jun 6, 2026
Merged

fix(#120): ensure message handling in journal logging command#121
GingerGraham merged 2 commits into
mainfrom
fix/issue-120

Conversation

@GingerGraham

Copy link
Copy Markdown
Owner

This pull request makes a minor update to the logging functionality by improving how messages are passed to the logger command in the logging.sh script.

  • Improved logger command invocation:
    • Added the -- argument before the message in the logger command to ensure that messages beginning with a hyphen are not misinterpreted as options. (logging.sh)

Copilot AI review requested due to automatic review settings June 6, 2026 20:22
@GingerGraham GingerGraham linked an issue Jun 6, 2026 that may be closed by this pull request

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens journal logging by ensuring messages passed to the external logger command cannot be misinterpreted as command-line options when they begin with -.

Changes:

  • Add -- to the logger invocation in _write_to_journal to end option parsing before the message argument.

Comment thread logging.sh
Copilot AI added a commit that referenced this pull request Jun 6, 2026
Adds test_write_to_journal_passes_double_dash_before_message to
test_journal_logging.sh to assert that log_to_journal passes --
before the message argument when calling logger, preventing
option-injection for messages that begin with a hyphen (e.g.
'-n not-an-option').

Uses assert_contains on the captured stub output instead of
assert_file_contains to avoid a grep quirk where patterns starting
with '--' are misinterpreted as long option names on this platform.

Closes review comment #121 (comment)
…_journal` (#122)

* Initial plan

* test: add regression test for -- separator in _write_to_journal

Adds test_write_to_journal_passes_double_dash_before_message to
test_journal_logging.sh to assert that log_to_journal passes --
before the message argument when calling logger, preventing
option-injection for messages that begin with a hyphen (e.g.
'-n not-an-option').

Uses assert_contains on the captured stub output instead of
assert_file_contains to avoid a grep quirk where patterns starting
with '--' are misinterpreted as long option names on this platform.

Closes review comment #121 (comment)

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@GingerGraham GingerGraham merged commit 19ba794 into main Jun 6, 2026
5 of 6 checks passed
@GingerGraham GingerGraham deleted the fix/issue-120 branch June 6, 2026 20:41
GingerGraham pushed a commit that referenced this pull request Jun 6, 2026
## [2.5.5](2.5.4...2.5.5) (2026-06-06)

### Bug Fixes

* **#120:** ensure message handling in journal logging command ([#121](#121))
@GingerGraham

Copy link
Copy Markdown
Owner Author

🎉 This PR is included in version 2.5.5 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] messages prefixed with dashes rejected by logger

3 participants