summaryrefslogtreecommitdiffhomepage
path: root/src/driver/pe_driver_ctx.c
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2025-06-18 16:34:36 +0000
committermidipix <writeonce@midipix.org>2025-06-18 16:55:23 +0000
commitd63dd27035006aa179176fe10d78486044c0dba0 (patch)
tree0e9cf14a4956274cad8fc829b3ae6062bbe714ed /src/driver/pe_driver_ctx.c
parent9ba2d8b59974cda85342901ea143623a19806a98 (diff)
downloadperk-d63dd27035006aa179176fe10d78486044c0dba0.tar.bz2
perk-d63dd27035006aa179176fe10d78486044c0dba0.tar.xz
driver: added --cmd=nm support, the pe_cmd_nm() stub, and the perk-nm symlink.
Diffstat (limited to 'src/driver/pe_driver_ctx.c')
-rw-r--r--src/driver/pe_driver_ctx.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/driver/pe_driver_ctx.c b/src/driver/pe_driver_ctx.c
index 9e6a17e..bbd5195 100644
--- a/src/driver/pe_driver_ctx.c
+++ b/src/driver/pe_driver_ctx.c
@@ -29,6 +29,7 @@ static const struct pe_source_version pe_src_version = {
static const char * const perk_cmd_name[PERK_CMD_CAP] = {
[PERK_CMD_PERK] = "perk",
[PERK_CMD_AR] = "ar",
+ [PERK_CMD_NM] = "nm",
};
/* perk command options */
@@ -36,6 +37,7 @@ static const struct argv_option * perk_cmd_options[PERK_CMD_CAP] = {
[PERK_CMD_DEFAULT] = pe_default_options,
[PERK_CMD_PERK] = pe_perk_options,
[PERK_CMD_AR] = pe_ar_options,
+ [PERK_CMD_NM] = pe_nm_options,
};
/* default fd context */
@@ -98,6 +100,12 @@ static int pe_driver_usage(
cmdname,cmdname,cmdname);
break;
+ case PERK_CMD_NM:
+ snprintf(header,sizeof(header),
+ PERK_NM_CMD_SYNOPSIS,
+ cmdname,cmdname);
+ break;
+
case PERK_CMD_PERK:
snprintf(header,sizeof(header),
PERK_PERK_CMD_SYNOPSIS,
@@ -176,6 +184,9 @@ static int pe_cmd_from_program(const char * program)
} else if (!strcmp(mark,"ar")) {
return PERK_CMD_AR;
+ } else if (!strcmp(mark,"nm")) {
+ return PERK_CMD_NM;
+
} else {
return PERK_CMD_DEFAULT;
}
@@ -487,6 +498,9 @@ int pe_lib_get_driver_ctx(
} else if (cctx.cmd == PERK_CMD_AR) {
argv_optv_init(pe_ar_options,optv);
+
+ } else if (cctx.cmd == PERK_CMD_NM) {
+ argv_optv_init(pe_nm_options,optv);
}
/* process the selected tool's command-line arguments */