summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-06-22 08:55:55 +0000
committermidipix <writeonce@midipix.org>2024-06-22 13:40:14 +0000
commit7f4d3217371bf518bb976c43a022b9365737aab7 (patch)
tree892e81f1ca63766cd0ee4ae8e9258c138bc0db97 /src
parent82d83bfbd7aea5f2d2feacae85bc2770b433ce2a (diff)
downloadslibtool-7f4d3217371bf518bb976c43a022b9365737aab7.tar.bz2
slibtool-7f4d3217371bf518bb976c43a022b9365737aab7.tar.xz
argv.h: argv_show_status(): output keyval pairs where appropriate.
Diffstat (limited to 'src')
-rw-r--r--src/internal/argv/argv.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/internal/argv/argv.h b/src/internal/argv/argv.h
index aa4e5f5..0b9def7 100644
--- a/src/internal/argv/argv.h
+++ b/src/internal/argv/argv.h
@@ -856,8 +856,10 @@ static void argv_show_status(
struct argv_ctx * ctx,
struct argv_meta * meta)
{
+ int i;
int argc;
char ** argv;
+ struct argv_keyval * keyv;
struct argv_entry * entry;
const struct argv_option * option;
char short_name[2] = {0};
@@ -887,6 +889,27 @@ static void argv_show_status(
else
argv_dprintf(fd,"[-%s,--%s]\n",
short_name,option->long_name);
+
+ if (entry->keyv) {
+ for (i=0,keyv=entry->keyv; keyv->keyword; i++,keyv++) {
+ switch (keyv->flags) {
+ case ARGV_KEYVAL_ASSIGN:
+ argv_dprintf(fd,"\tkeyval[%d]: <%s>=%s\n",
+ i,keyv->keyword,keyv->value);
+ break;
+
+ case ARGV_KEYVAL_OVERRIDE:
+ argv_dprintf(fd,"\tkeyval[%d]: <%s>:=%s\n",
+ i,keyv->keyword,keyv->value);
+ break;
+
+ default:
+ argv_dprintf(fd,"\tkeyval[%d]: <%s>\n",
+ i,keyv->keyword);
+ break;
+ }
+ }
+ }
} else {
argv_dprintf(fd,"<program arg> := %s\n",entry->arg);
}