nzw921rx opened a new issue, #13016:
URL: https://github.com/apache/seatunnel/issues/13016

   ### Search before asking
   
   - [x] I had searched in the 
[feature](https://github.com/apache/seatunnel/issues?q=is%3Aissue+label%3A%22Feature%22)
 and found no similar feature requirement.
   
   
   ### Description
   
   
   ## Background
   
   Printing help is a successful CLI operation and should exit with `0`.
   
   PR #12898 updates the help exit codes of `seatunnel.sh` and 
`seatunnel-application.sh`. Several other native CLI entrypoints still return 
`234` when printing help.
   
   ## Remaining entrypoints
   
   | Entrypoint | Current help exit code | Expected |
   | --- | --- | --- |
   | `seatunnel-cluster.sh` | `234` | `0` |
   | `seatunnel-connector.sh` | `234` | `0` |
   | `seatunnel-metadata-export.sh` | `234` | `0` |
   | Edge Agent `-h` / `--help` | `234` | `0` |
   | Edge Agent `db -h` / `db --help` / `db help` | `234` | `0` |
   
   The Core entrypoints are `SeaTunnelServer`, `SeaTunnelConnector`, and 
`SeaTunnelMetadataExporter`. They still use the shared parser's default usage 
exit code.
   
   Edge Agent uses a separate `EdgeAgentCommandLineUtils` parser. Its DB help 
command also explicitly exits with `USAGE_EXIT_CODE`.
   
   ## Flink/Spark compatibility
   
   SeaTunnel's Flink/Spark Java Starters must retain their existing internal 
exit-code contract:
   
   - `0`: a submission command was generated; the shell wrapper executes it.
   - `234`: usage was printed; the shell wrapper prints the output and exits 
with `0`.
   - Other nonzero codes: launcher failures are propagated.
   
   Changing their Java help exit code to `0` would make the wrappers attempt to 
execute help text.
   
   ## Suggested changes
   
   - Explicitly select help exit code `0` in the remaining native Core 
entrypoints, following #12898.
   - Separate successful help from argument errors in Edge Agent, including its 
DB help command.
   - Preserve the shared default `USAGE_EXIT_CODE = 234` for Flink/Spark 
compatibility.
   - Keep argument errors and operational failures nonzero.
   - Preserve normal execution, foreground `exec`, daemon startup, and 
exit-code propagation.
   
   ## Validation
   
   - Verify `-h` and `--help` print usage and exit with `0` for the listed 
native entrypoints.
   - Verify Cluster help with default, master, and worker roles.
   - Verify `seatunnel-cluster.sh -d --help` exits with `0` without launching a 
background server.
   - Verify Edge Agent DB help variants exit with `0`.
   - Verify invalid arguments still return nonzero.
   - Verify Flink/Spark Java help remains `234`, while their shell wrappers 
return `0` without submitting a job.
   - Verify normal Flink/Spark command generation and failure propagation 
remain unchanged.
   - Check corresponding Windows launchers where available.
   
   Related: #12898.
   
   This is a non-blocking CLI consistency improvement.
   
   ### Usage Scenario
   
   _No response_
   
   ### Related issues
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to