fix: CLI update warns on empty content + better --format position error#256
Merged
raifdmueller merged 3 commits intodocToolchain:mainfrom Feb 7, 2026
Merged
Conversation
raifdmueller
commented
Feb 7, 2026
Collaborator
Author
raifdmueller
left a comment
There was a problem hiding this comment.
Code Review
Overall: Very good
#176 - GlobalOptionHintCommand
Elegant approach: custom click.Command subclass catches UsageError, checks if a global option was misplaced, and provides a helpful hint. Applied to all subcommands via command_class on AliasedGroup. Clean and extensible.
#250 - Empty content warning
Minimal and correct: click.echo("Warning: ...", err=True) before the update call. Warning only, doesn't block the operation.
Tests
8 tests covering both features across multiple commands. Good coverage.
Version Conflict
All 3 PRs bump to 0.4.25. Will need rebase after first merge.
Reviewed-by: R{AI}f D. Müller (AI-assisted review)
…or (docToolchain#250, docToolchain#176) - Issue docToolchain#250: `update --content ""` now prints a warning to stderr ("Warning: Section content will be cleared.") instead of silently clearing the section. - Issue docToolchain#176: When users place --format after the command (e.g. `dacli structure --format json`), the error message now explains that --format is a global option and must be placed before the command. Uses a GlobalOptionHintCommand class applied to all subcommands via AliasedGroup.command_class. - Bump version to 0.4.25. Fixes docToolchain#250, Fixes docToolchain#176 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…cToolchain#251) When AsciiDoc files include each other circularly, they were reported as "orphaned files" because the parser threw CircularIncludeError causing documents to not load. Now detect cycles in the include graph during index building and report them as "circular_include" errors in validation. Fixes docToolchain#251 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1e257b9 to
88f33c4
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
updatecommand now prints a warning to stderr when content is empty or whitespace-only, instead of silently clearing the section--format(or other global options) after the command, the error message now explains these are global options that must be placed before the commandChanges
GlobalOptionHintCommandclass that intercepts "No such option" errors for known global options and provides a helpful hintcommand_class = GlobalOptionHintCommandonAliasedGroupso all subcommands benefit automaticallyclick.echo(..., err=True)) in theupdatecommand before callingservice_update_sectionTest plan
tests/test_cli_enhancements_176_250.py--formatafter command gives helpful error mentioning global option placement--formatbefore command still works correctlyFixes #250, Fixes #176
🤖 Generated with Claude Code