Skip to content

feat(cli): --annotate-block takes the same optional type as --annotate - #183

Merged
backnotprop merged 1 commit into
mainfrom
feat/annotate-block-type
Nov 22, 2026
Merged

backnotprop merged 1 commit into
mainfrom
feat/annotate-block-type

Conversation

@backnotprop

Copy link
Copy Markdown
Contributor

--annotate-block <file.md> <block> <text> now takes the same optional trailing type as --annotate: comment, looks_good or delete.

  • The type is read by the parser --annotate already uses (annotate_options). There is no second copy of the parsing.
  • With no type, the block gets a comment, as before. Existing callers are unchanged.
  • <text> is the note's body, as with --annotate. It is still required, and it may be empty for any type. With delete and an empty body, the export says "I don't want this."; with looks_good it shows no body line.
  • What --annotate refuses after the type is refused here with the same wording: a second word (unexpected argument) and an unknown flag (unknown flag). A block is one place, so --occurrence is an unknown flag for --annotate-block.
  • Usage text and the crate README show the new argument.

Tests (tests/annotate_block.rs, through the real binary and a private data dir): each of the three types lands on its block with the right kind in the export; no type gives a comment; refused arguments fail and save nothing.

Note: --annotate turns a type it does not know (for example bogus) into a comment without an error. --annotate-block now does the same, because it shares the parser. This PR does not change that.

Closes #138

@backnotprop
backnotprop added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit 4787e01 Nov 22, 2026
3 checks passed
@backnotprop
backnotprop deleted the feat/annotate-block-type branch November 22, 2026 03:31
@backnotprop backnotprop mentioned this pull request Nov 23, 2026
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.

Block-level looks good and delete shortcuts, like c already does for comments

1 participant