diff options
author | midipix <writeonce@midipix.org> | 2024-01-22 00:59:55 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2024-01-22 03:49:50 +0000 |
commit | 0b535fd267e5b8ebc031b5ca24984102adada87a (patch) | |
tree | f0893f55e45f1102a8f8f5b1cdff3290d2d92ca7 | |
parent | 55f01bacfe807bbc3fd984726ca6280653d814bf (diff) | |
download | slibtool-0b535fd267e5b8ebc031b5ca24984102adada87a.tar.bz2 slibtool-0b535fd267e5b8ebc031b5ca24984102adada87a.tar.xz |
driver: slbt_main(): --version conformance: print program version, then exit.
-rw-r--r-- | src/driver/slbt_amain.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/driver/slbt_amain.c b/src/driver/slbt_amain.c index 1cc1c07..2359293 100644 --- a/src/driver/slbt_amain.c +++ b/src/driver/slbt_amain.c @@ -176,10 +176,11 @@ int slbt_main(char ** argv, char ** envp, const struct slbt_fd_ctx * fdctx) return slbt_output_machine(dctx) ? SLBT_ERROR : SLBT_OK; - /* --version is always the first action */ + /* --version must be the first (and only) action */ if (dctx->cctx->drvflags & SLBT_DRIVER_VERSION) - if ((slbt_version(dctx,fdout)) < 0) - return slbt_exit(dctx,SLBT_ERROR); + return (slbt_version(dctx,fdout) < 0) + ? slbt_exit(dctx,SLBT_ERROR) + : slbt_exit(dctx,SLBT_OK); slbt_perform_driver_actions(dctx); |