{"record":{"id":"5854ae62353da054","repo":"benbjohnson/litestream","slug":"too-many-arguments-5854ae","errorCode":null,"errorMessage":"too many arguments","messagePattern":"too many arguments","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/litestream/info.go","lineNumber":31,"sourceCode":"\t\"github.com/benbjohnson/litestream\"\n)\n\n// InfoCommand represents the command to show daemon information.\ntype InfoCommand struct{}\n\n// Run executes the info command.\nfunc (c *InfoCommand) Run(_ context.Context, args []string) error {\n\tfs := flag.NewFlagSet(\"litestream-info\", flag.ContinueOnError)\n\tsocketPath := fs.String(\"socket\", \"/var/run/litestream.sock\", \"control socket path\")\n\ttimeout := fs.Int(\"timeout\", 10, \"timeout in seconds\")\n\tjsonOutput := fs.Bool(\"json\", false, \"output raw JSON\")\n\tfs.Usage = c.Usage\n\tif err := fs.Parse(args); err != nil {\n\t\treturn err\n\t}\n\n\tif fs.NArg() > 0 {\n\t\treturn fmt.Errorf(\"too many arguments\")\n\t}\n\n\tif *timeout <= 0 {\n\t\treturn fmt.Errorf(\"timeout must be greater than 0\")\n\t}\n\n\tclientTimeout := time.Duration(*timeout) * time.Second\n\tclient := &http.Client{\n\t\tTimeout: clientTimeout,\n\t\tTransport: &http.Transport{\n\t\t\tDialContext: func(_ context.Context, _, _ string) (net.Conn, error) {\n\t\t\t\treturn net.DialTimeout(\"unix\", *socketPath, clientTimeout)\n\t\t\t},\n\t\t},\n\t}\n\n\tresp, err := client.Get(\"http://localhost/info\")\n\tif err != nil {","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/benbjohnson/litestream/blob/4ed7a308f6271ebfd2b0a6e4b70b03011a37e4a3/cmd/litestream/info.go#L13-L49","documentation":"The `litestream info` command rejects invocation with any positional arguments. After flag parsing, Run checks fs.NArg() and returns this error because info takes no positional arguments; it gathers data from the control socket instead. This is a CLI usage guard so misdirected arguments fail fast rather than being silently ignored.","triggerScenarios":"Running `litestream info <something>` where <something> is any extra positional argument, e.g. `litestream info my.db` or a stray flag value that consumed its own flag and left a bare token.","commonSituations":"Users migrating from older litestream versions where info or similar commands accepted a database path; copy-pasting `litestream info /path/to/db` from docs; a flag written as `--flag value` in a context where it should be `--flag=value`, leaving 'value' as a positional arg.","solutions":["Remove all positional arguments and run plain `litestream info` with only flags (e.g. --timeout, --json).","If you meant to pass a database path, note info queries the running daemon via the control socket; edit the config file instead or use the appropriate subcommand.","Check that each flag value is attached correctly (`--flag=value` or `--flag value` exactly once) so no token is left over as positional."],"exampleFix":"// before\n$ litestream info /var/lib/app.db\n// after\n$ litestream info","handlingStrategy":"validation","validationCode":"const args = process.argv.slice(2).filter(a => !a.startsWith('-'));\nif (args.length > 0) throw new Error('litestream info accepts no positional arguments');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never pass a database path to `litestream info`; it queries the daemon's control socket.","Write flags as --flag=value in scripts to avoid stray tokens becoming positional args.","Check `litestream info --help` before scripting the command."],"tags":["cli","usage"],"backgroundTag":"invalid-cli-argument","analyzedSha":"4ed7a308f6271ebfd2b0a6e4b70b03011a37e4a3","analyzedAt":"2026-09-06T18:29:25.564Z","contentChangedAt":"2026-09-06T18:29:25.564Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}