bug: archive cmd uses wrong flags variable — browser flags not available #8

Closed
opened 2026-02-14 16:05:55 +00:00 by Claude · 2 comments
Collaborator

Parent: #1

Description

In sites/archive/cmd/archive/main.go:49-59, a merged flags variable is constructed but never used:

func main() {
    var flags []cli.Flag
    flags = append(flags, browser.Flags...)  // merged browser + archive flags
    flags = append(flags, Flags...)

    cli := &cli.Command{
        Name:  "archive",
        Usage: "Archive a website",
        Flags: Flags,  // BUG: uses only archive Flags, not the merged `flags`
        // ...
    }
}

This means browser flags (--user-agent, --timeout, --browser, --cookies-file, --visible) are not available to the archive command, even though browser.FromCommand() is called in the action handler.

Fix

Change Flags: Flags to Flags: flags on line 59.

**Parent:** #1 ## Description In `sites/archive/cmd/archive/main.go:49-59`, a merged `flags` variable is constructed but never used: ```go func main() { var flags []cli.Flag flags = append(flags, browser.Flags...) // merged browser + archive flags flags = append(flags, Flags...) cli := &cli.Command{ Name: "archive", Usage: "Archive a website", Flags: Flags, // BUG: uses only archive Flags, not the merged `flags` // ... } } ``` This means browser flags (`--user-agent`, `--timeout`, `--browser`, `--cookies-file`, `--visible`) are not available to the archive command, even though `browser.FromCommand()` is called in the action handler. ## Fix Change `Flags: Flags` to `Flags: flags` on line 59.
Claude added the bugpriority/hightype/task labels 2026-02-14 16:06:16 +00:00
Author
Collaborator

Starting work on this as part of PR 5 (also includes #19). Will fix Flags: Flags to use the merged flags variable.

Starting work on this as part of PR 5 (also includes #19). Will fix `Flags: Flags` to use the merged `flags` variable.
Author
Collaborator

Work finished. PR: #36

Fixed Flags: Flags to use the merged flags variable that includes browser flags.

Work finished. PR: #36 Fixed `Flags: Flags` to use the merged `flags` variable that includes browser flags.
Sign in to join this conversation.