Skip to content

Conversation

@richardwooding
Copy link
Collaborator

Summary

Changes

Bug Fix (cmd/root.go)

  • Fixed typo: output-drectoryoutput-directory
  • Added missing viper.BindPFlag() for output-directory flag
  • Fixed description typo: "director" → "directory"

Without the viper binding, the -o flag was not working correctly as viper couldn't access the flag value.

Documentation (CLAUDE.md)

Added comprehensive documentation including:

  • Project overview and architecture
  • Development commands (build, test, run)
  • CLI flags reference
  • Release process
  • Key dependencies

Build (.gitignore)

  • Added codeblocks binary to .gitignore

Test Plan

  • Built project successfully with go build -v ./...
  • Ran tests with go test -v ./...
  • Verified -o flag works correctly by extracting code blocks to a test directory
  • Confirmed extracted files have correct content

🤖 Generated with Claude Code

richardwooding and others added 2 commits January 8, 2026 15:48
- Fixed typo: output-drectory -> output-directory
- Added missing viper.BindPFlag() for output-directory flag
- Fixed description typo: "director" -> "directory"

Fixes #5

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Added CLAUDE.md with project architecture and development commands
- Updated .gitignore to exclude built binary

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@richardwooding richardwooding requested a review from Copilot January 8, 2026 13:55
@richardwooding richardwooding merged commit 9f22550 into main Jan 8, 2026
6 checks passed
Copy link

Copilot AI left a comment

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 fixes a critical bug in the output-directory flag and adds comprehensive project documentation. The flag had a typo in its name and was missing the viper binding, making the -o option non-functional.

Key changes:

  • Fixed typo and added viper binding for the output-directory flag in cmd/root.go
  • Added CLAUDE.md with project architecture, development commands, and CLI reference
  • Updated .gitignore to exclude the built codeblocks binary

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
cmd/root.go Corrected flag name typo from output-drectory to output-directory, fixed description typo, and added missing viper binding for the flag
CLAUDE.md Added comprehensive documentation file for Claude Code with project overview, architecture, development commands, and dependencies
.gitignore Added codeblocks binary to exclusion list

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


## Known Issues

- [Issue #5](https://github.com/SPANDigital/codeblocks/issues/5) - Typo in `output-directory` flag and missing viper binding (cmd/root.go:156)
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

This line references Issue #5 as a known issue with the typo in output-directory flag and missing viper binding. However, this PR is fixing that exact issue. The "Known Issues" section should either be removed or updated to remove this fixed issue, since it will no longer be applicable once this PR is merged.

Suggested change
- [Issue #5](https://github.com/SPANDigital/codeblocks/issues/5) - Typo in `output-directory` flag and missing viper binding (cmd/root.go:156)
- None currently.

Copilot uses AI. Check for mistakes.
@richardwooding richardwooding deleted the fix-output-directory-flag branch January 8, 2026 14:00
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.

Fix typo in output-directory flag and add missing viper binding

1 participant