diff options
author | midipix <writeonce@midipix.org> | 2024-01-22 01:42:49 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2024-01-22 03:49:50 +0000 |
commit | b87f7032b8573966b0537698544c65fbb3f2c143 (patch) | |
tree | eadd79d7237281dede96a0908fde5ccea6c71cbe /src/driver/slbt_amain.c | |
parent | 0b535fd267e5b8ebc031b5ca24984102adada87a (diff) | |
download | slibtool-b87f7032b8573966b0537698544c65fbb3f2c143.tar.bz2 slibtool-b87f7032b8573966b0537698544c65fbb3f2c143.tar.xz |
ar mode: added --version support.
Diffstat (limited to 'src/driver/slbt_amain.c')
-rw-r--r-- | src/driver/slbt_amain.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/driver/slbt_amain.c b/src/driver/slbt_amain.c index 2359293..b6bbe40 100644 --- a/src/driver/slbt_amain.c +++ b/src/driver/slbt_amain.c @@ -178,11 +178,19 @@ int slbt_main(char ** argv, char ** envp, const struct slbt_fd_ctx * fdctx) /* --version must be the first (and only) action */ if (dctx->cctx->drvflags & SLBT_DRIVER_VERSION) + if (dctx->cctx->mode != SLBT_MODE_AR) + return (slbt_version(dctx,fdout) < 0) + ? slbt_exit(dctx,SLBT_ERROR) + : slbt_exit(dctx,SLBT_OK); + + /* perform all other actions */ + slbt_perform_driver_actions(dctx); + + /* print --version on behalf of a secondary tool as needed */ + if (dctx->cctx->drvflags & SLBT_DRIVER_VERSION) return (slbt_version(dctx,fdout) < 0) ? slbt_exit(dctx,SLBT_ERROR) : slbt_exit(dctx,SLBT_OK); - slbt_perform_driver_actions(dctx); - return slbt_exit(dctx,dctx->errv[0] ? SLBT_ERROR : SLBT_OK); } |