summaryrefslogtreecommitdiffhomepage
path: root/src/driver
diff options
context:
space:
mode:
Diffstat (limited to 'src/driver')
-rw-r--r--src/driver/ntux_amain.c12
-rw-r--r--src/driver/ntux_driver_ctx.c3
2 files changed, 15 insertions, 0 deletions
diff --git a/src/driver/ntux_amain.c b/src/driver/ntux_amain.c
index 709c73b..6b9acf4 100644
--- a/src/driver/ntux_amain.c
+++ b/src/driver/ntux_amain.c
@@ -47,6 +47,14 @@ static ssize_t ntux_version(struct ntux_driver_ctx * dctx)
verclr[4],verinfo->commit,verclr[5]);
}
+static void ntux_perform_unit_actions(
+ const struct ntux_driver_ctx * dctx,
+ const char * unit)
+{
+ (void)dctx;
+ (void)unit;
+}
+
static int ntux_exit(struct ntux_driver_ctx * dctx, int ret)
{
ntux_free_driver_ctx(dctx);
@@ -57,6 +65,7 @@ int ntux_main(int argc, char ** argv, char ** envp)
{
int ret;
struct ntux_driver_ctx * dctx;
+ const char ** unit;
if ((ret = ntux_get_driver_ctx(argv,envp,NTUX_DRIVER_FLAGS,&dctx)))
return (ret == NTUX_USAGE)
@@ -67,5 +76,8 @@ int ntux_main(int argc, char ** argv, char ** envp)
if ((ntux_version(dctx)) < 0)
return ntux_exit(dctx,NTUX_ERROR);
+ for (unit=dctx->units; *unit; unit++)
+ ntux_perform_unit_actions(dctx,*unit);
+
return ntux_exit(dctx,dctx->errv[0] ? NTUX_ERROR : NTUX_OK);
}
diff --git a/src/driver/ntux_driver_ctx.c b/src/driver/ntux_driver_ctx.c
index 0398d5f..2aca14c 100644
--- a/src/driver/ntux_driver_ctx.c
+++ b/src/driver/ntux_driver_ctx.c
@@ -175,6 +175,9 @@ int ntux_get_driver_ctx(
nunits++;
}
+ if (nunits && !cctx.cmd)
+ return ntux_driver_usage(program,0,optv,meta);
+
if (!(ctx = ntux_driver_ctx_alloc(meta,&cctx,nunits)))
return ntux_get_driver_ctx_fail(meta);