summaryrefslogtreecommitdiff
path: root/src/driver
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-01-22 01:42:49 +0000
committermidipix <writeonce@midipix.org>2024-01-22 03:49:50 +0000
commitb87f7032b8573966b0537698544c65fbb3f2c143 (patch)
treeeadd79d7237281dede96a0908fde5ccea6c71cbe /src/driver
parent0b535fd267e5b8ebc031b5ca24984102adada87a (diff)
downloadslibtool-b87f7032b8573966b0537698544c65fbb3f2c143.tar.bz2
slibtool-b87f7032b8573966b0537698544c65fbb3f2c143.tar.xz
ar mode: added --version support.
Diffstat (limited to 'src/driver')
-rw-r--r--src/driver/slbt_amain.c12
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);
}