Skip to content

feat: support directory arguments to open .md files inside#137

Merged
k1LoW merged 7 commits intomainfrom
feat/directory-args
Mar 24, 2026
Merged

feat: support directory arguments to open .md files inside#137
k1LoW merged 7 commits intomainfrom
feat/directory-args

Conversation

@k1LoW
Copy link
Copy Markdown
Owner

@k1LoW k1LoW commented Mar 24, 2026

Summary

  • When a directory is passed as a CLI argument, expand *.md files directly under that directory instead of returning an error
  • When combined with --watch, the directory is converted to a watch pattern (dir/*.md) so new files are picked up automatically
  • Empty directories (no .md files) return an error when used without --watch; with --watch, the pattern is registered to watch for future files

Closes #134

k1LoW added 2 commits March 24, 2026 21:39
When a directory is passed as a CLI argument, expand it to all `*.md`
files directly under that directory instead of returning an error.

When combined with `--watch`, the directory is converted to a watch
pattern (`dir/*.md`) so new files are picked up automatically.

Closes #134

This comment was marked as outdated.

@github-actions

This comment has been minimized.

hasNonDirArgs now skips paths that don't exist or can't be stat'd,
so the mutual exclusion error is only raised for actual file args.
Non-existent paths get a proper "file not found" from resolveArgs.
@github-actions

This comment has been minimized.

@k1LoW k1LoW self-assigned this Mar 24, 2026

This comment was marked as outdated.

- Distinguish os.ErrNotExist from other stat errors (e.g. permission
  denied) to provide accurate diagnostics.
- Filter out directory entries from filepath.Glob results to avoid
  confusing failures when a subdirectory matches *.md.
@k1LoW k1LoW requested a review from Copilot March 24, 2026 13:00
@github-actions
Copy link
Copy Markdown
Contributor

Code Metrics Report

main (738858d) #137 (5217a0a) +/-
Coverage 56.3% 57.1% +0.8%
Code to Test Ratio 1:0.5 1:0.5 +0.0
Test Execution Time 29s 29s 0s
Details
  |                     | main (738858d) | #137 (5217a0a) |  +/-  |
  |---------------------|----------------|----------------|-------|
+ | Coverage            |          56.3% |          57.1% | +0.8% |
  |   Files             |             39 |             39 |     0 |
  |   Lines             |           3219 |           3256 |   +37 |
+ |   Covered           |           1814 |           1861 |   +47 |
+ | Code to Test Ratio  |          1:0.5 |          1:0.5 |  +0.0 |
  |   Code              |           5014 |           5014 |     0 |
+ |   Test              |           2679 |           2846 |  +167 |
  | Test Execution Time |            29s |            29s |    0s |

Code coverage of files in pull request scope (24.6% → 28.7%)

Files Coverage +/- Status
cmd/root.go 28.7% +4.0% modified

Reported by octocov

Copy link
Copy Markdown
Contributor

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@k1LoW k1LoW merged commit a5a0dee into main Mar 24, 2026
7 checks passed
@k1LoW k1LoW deleted the feat/directory-args branch March 24, 2026 13:03
@github-actions github-actions bot mentioned this pull request Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: suggest watching when a directory is passed as argument

2 participants