{"record":{"id":"afb23960d4e6924c","repo":"wavetermdev/waveterm","slug":"no-arguments-wsh-wavepath-requires-a-type-argumen","errorCode":null,"errorMessage":"no arguments. wsh wavepath requires a type argument (config, data, or log)","messagePattern":"no arguments\\. wsh wavepath requires a type argument \\(config, data, or log\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/wsh/cmd/wshcmd-wavepath.go","lineNumber":38,"sourceCode":"\tRunE:    wavepathRun,\n\tPreRunE: preRunSetupRpcClient,\n}\n\nfunc init() {\n\twavepathCmd.Flags().BoolP(\"open\", \"o\", false, \"Open the path in a new block\")\n\twavepathCmd.Flags().BoolP(\"open-external\", \"O\", false, \"Open the path in the default external application\")\n\twavepathCmd.Flags().BoolP(\"tail\", \"t\", false, \"Tail the last 100 lines of the log\")\n\trootCmd.AddCommand(wavepathCmd)\n}\n\nfunc wavepathRun(cmd *cobra.Command, args []string) (rtnErr error) {\n\tdefer func() {\n\t\tsendActivity(\"wavepath\", rtnErr == nil)\n\t}()\n\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\")","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/cmd/wsh/cmd/wshcmd-wavepath.go#L20-L56","documentation":"`wsh wavepath` prints Wave's config, data, or log directory path. wavepathRun requires exactly one positional argument naming the type; with zero arguments it prints help and returns this error naming the valid types.","triggerScenarios":"Running `wsh wavepath` with no argument, or via a script where the type variable is empty (`wsh wavepath $TYPE` with TYPE unset).","commonSituations":"Forgetting the subargument after upgrade; examples/copied commands missing the type; empty variable expansion in shell scripts.","solutions":["Run with a type: `wsh wavepath config`, `wsh wavepath data`, or `wsh wavepath log`","Guard scripted usage: `[ -n \"$TYPE\" ] && wsh wavepath \"$TYPE\"`","Use `wsh wavepath --help` for usage"],"exampleFix":"// before\n$ wsh wavepath\n\n// after\n$ wsh wavepath config","handlingStrategy":"validation","validationCode":"if [ -z \"$TYPE\" ]; then echo \"usage: wsh wavepath <config|data|log>\" >&2; exit 2; fi\nwsh wavepath \"$TYPE\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always supply one of config|data|log","Validate script variables before expansion"],"tags":["cli","argument-validation","wsh"],"backgroundTag":"missing-required-cli-argument","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}