{"record":{"id":"35ea44747409ae71","repo":"argoproj/argo-workflows","slug":"wait-cannot-be-combined-with-watch","errorCode":null,"errorMessage":"--wait cannot be combined with --watch","messagePattern":"--wait cannot be combined with --watch","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/argo/commands/submit.go","lineNumber":142,"sourceCode":"\t\treturn err\n\t}\n\n\tvar workflows []wfv1.Workflow\n\tfor _, body := range fileContents {\n\t\twfs := unmarshalWorkflows(ctx, body, cliOpts.Strict)\n\t\tworkflows = append(workflows, wfs...)\n\t}\n\n\treturn submitWorkflows(ctx, serviceClient, namespace, workflows, submitOpts, cliOpts)\n}\n\nfunc validateOptions(workflows []wfv1.Workflow, submitOpts *wfv1.SubmitOpts, cliOpts *common.CliSubmitOpts) error {\n\tif cliOpts.Watch {\n\t\tif len(workflows) > 1 {\n\t\t\treturn errors.New(\"cannot watch more than one workflow\")\n\t\t}\n\t\tif cliOpts.Wait {\n\t\t\treturn errors.New(\"--wait cannot be combined with --watch\")\n\t\t}\n\t\tif submitOpts.DryRun {\n\t\t\treturn errors.New(\"--watch cannot be combined with --dry-run\")\n\t\t}\n\t\tif submitOpts.ServerDryRun {\n\t\t\treturn errors.New(\"--watch cannot be combined with --server-dry-run\")\n\t\t}\n\t}\n\n\tif cliOpts.Wait {\n\t\tif submitOpts.DryRun {\n\t\t\treturn errors.New(\"--wait cannot be combined with --dry-run\")\n\t\t}\n\t\tif submitOpts.ServerDryRun {\n\t\t\treturn errors.New(\"--wait cannot be combined with --server-dry-run\")\n\t\t}\n\t}\n","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/cmd/argo/commands/submit.go#L124-L160","documentation":"--watch (live streaming TUI-style progress) and --wait (block until completion, no stream) are two different completion-tracking modes and are mutually exclusive. validateOptions in cmd/argo/commands/submit.go rejects the combination before submitting.","triggerScenarios":"`argo submit my-wf.yaml --wait --watch` — cliOpts.Watch && cliOpts.Wait both true.","commonSituations":"Appending --wait to a scripted command that already uses --watch; assuming the flags are additive; CI wrappers that always add --wait.","solutions":["Keep only --watch (it already blocks and shows progress)","Or keep only --wait for non-interactive CI usage","In wrappers, make the flags mutually exclusive"],"exampleFix":"// before\nargo submit my-wf.yaml --wait --watch\n// after\nargo submit my-wf.yaml --watch","handlingStrategy":"validation","validationCode":"case \" $FLAGS \" in *' --watch '*)( [ -n \"$WAIT\" ] && echo \"--wait cannot be combined with --watch\" >&2 && exit 2 ) ;; esac\n# pass only one of --wait / --watch to argo submit","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pick one tracking mode per command: --watch for interactive, --wait for CI","Don't globally append --wait in submit wrappers","Alias argo submit defaults to a single mode"],"tags":["cli","flag-conflict","argo-cli","submit"],"backgroundTag":"mutually-exclusive-flags","analyzedSha":"35bff19146f5a6ada77468c431f2624bd577e373","analyzedAt":"2026-09-03T19:34:35.908Z","contentChangedAt":"2026-09-03T19:34:35.908Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}