Skip to content

Follow-up: -w flag, negative tests, and test cleanup#6

Merged
mwittie merged 5 commits into
mainfrom
chore/cmd-improvements
Apr 30, 2026
Merged

Follow-up: -w flag, negative tests, and test cleanup#6
mwittie merged 5 commits into
mainfrom
chore/cmd-improvements

Conversation

@mwittie

@mwittie mwittie commented Apr 30, 2026

Copy link
Copy Markdown
Owner

Describe your changes

Changes that were missed when PR #5 was merged without pushing the local branch:

  • Add -w/--write flag to litdoc file for in-place rewrite via atomic temp+rename, preserving file mode.
  • Add negative testscript cases: missing args (cobra ExactArgs rejection) and missing path (ProcessFile error).
  • Move shared test harness (TestMain, runScript) from file_test.go into testscript_test.go.
  • Remove the block subcommand until an internal implementation exists.

Notes for reviewers

  • -w writes atomically: temp file in the same directory, chmod to preserve mode, then os.Rename.
  • No behavior changes to litdoc file beyond adding the flag.

Checklist before requesting a review

If any of these checks are missing, please provide an explanation.

  • I have updated README files, if applicable.
  • This PR is small, otherwise explain why.

mwittie added 5 commits April 30, 2026 12:37
Atomic via temp file in the same directory plus os.Rename, preserving
the original file mode.
Cover the cobra ExactArgs(1) rejection and the missing-path error path
through internal.ProcessFile.
@mwittie mwittie merged commit 3ff3fab into main Apr 30, 2026
1 check passed
@mwittie mwittie deleted the chore/cmd-improvements branch April 30, 2026 18:43
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