{"record":{"id":"48328d7bff5834b0","repo":"wavetermdev/waveterm","slug":"tail-can-only-be-used-with-the-log-path-type","errorCode":null,"errorMessage":"--tail can only be used with the log path type","messagePattern":"--tail can only be used with the log path type","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/wsh/cmd/wshcmd-wavepath.go","lineNumber":53,"sourceCode":"\n\tif len(args) == 0 {\n\t\tOutputHelpMessage(cmd)\n\t\treturn fmt.Errorf(\"no arguments. wsh wavepath requires a type argument (config, data, or log)\")\n\t}\n\tif len(args) > 1 {\n\t\tOutputHelpMessage(cmd)\n\t\treturn fmt.Errorf(\"too many arguments. wsh wavepath requires exactly one argument\")\n\t}\n\n\tpathType := args[0]\n\tif pathType != \"config\" && pathType != \"data\" && pathType != \"log\" {\n\t\tOutputHelpMessage(cmd)\n\t\treturn fmt.Errorf(\"invalid path type %q. must be one of: config, data, log\", pathType)\n\t}\n\n\ttail, _ := cmd.Flags().GetBool(\"tail\")\n\tif tail && pathType != \"log\" {\n\t\treturn fmt.Errorf(\"--tail can only be used with the log path type\")\n\t}\n\n\topen, _ := cmd.Flags().GetBool(\"open\")\n\topenExternal, _ := cmd.Flags().GetBool(\"open-external\")\n\n\ttabId := getTabIdFromEnv()\n\tif tabId == \"\" {\n\t\treturn fmt.Errorf(\"no WAVETERM_TABID env var set\")\n\t}\n\n\tpath, err := wshclient.PathCommand(RpcClient, wshrpc.PathCommandData{\n\t\tPathType:     pathType,\n\t\tOpen:         open,\n\t\tOpenExternal: openExternal,\n\t\tTabId:        tabId,\n\t}, nil)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"getting path: %w\", err)","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/cmd/wsh/cmd/wshcmd-wavepath.go#L35-L71","documentation":"The --tail flag streams the log file, so it is only meaningful with the 'log' path type. wavepathRun rejects any combination of --tail with 'config' or 'data'. This is pure client-side flag validation.","triggerScenarios":"Running `wsh wavepath config --tail` or `wsh wavepath data --tail`.","commonSituations":"Users copying a `wsh wavepath log --tail` invocation and swapping the path type while keeping --tail, or scripts that always append --tail.","solutions":["Use --tail only with `wsh wavepath log`.","Remove --tail when requesting the config or data path.","Split the script: print the path without --tail, tail separately with `wsh wavepath log --tail`."],"exampleFix":"// before\nwsh wavepath config --tail\n// after\nwsh wavepath config\nwsh wavepath log --tail","handlingStrategy":"validation","validationCode":"[ \"$pathType\" = \"log\" ] || unset tailFlag  # only pass --tail for log","typeGuard":"func tailAllowed(pathType string) bool { return pathType == \"log\" }","tryCatchPattern":null,"preventionTips":["Only combine --tail with `wsh wavepath log`.","In scripts, gate the flag on the path type.","Read --help output for flag constraints."],"tags":["cli","flag-validation","wsh"],"backgroundTag":"incompatible-flag-combination","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}