fix: address functionality gaps identified in code review

- Wire up --config/-f flag to actually load custom config files
  - Move config loading to PersistentPreRunE in root.go
  - Simplify main.go to just call cmd.Execute()
  - Move Playwright init to web command's PreRunE/PostRunE

- Remove unused functions from cmd/web.go (~90 lines of dead code)
  - Remove writeSingleFile, writeMultipleFiles, generateDefaultFilename
  - Remove scrapeURL, extractAndConvertContent, testExtractAndConvertContent
  - Remove unused mock function from web_test.go

- Add OutputType validation to Config.Validate()
  - Only allow "single", "separate", or empty string
  - Add test cases for valid and invalid output types
This commit is contained in:
Claude
2025-11-27 16:05:42 +00:00
parent 09608cf073
commit ff13012408
6 changed files with 68 additions and 129 deletions

View File

@@ -97,8 +97,3 @@ func TestGetFilenameFromContent(t *testing.T) {
}
}
}
// Mock functions for testing
func mockExtractAndConvertContent(urlStr string) (string, error) {
return "Mocked content for " + urlStr, nil
}