summaryrefslogtreecommitdiffstats
path: root/player/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'player/command.c')
-rw-r--r--player/command.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/player/command.c b/player/command.c
index a230ad460c..a6ceaf039a 100644
--- a/player/command.c
+++ b/player/command.c
@@ -3242,6 +3242,20 @@ static int mp_property_commands(void *ctx, struct m_property *prop,
struct mpv_node *entry = node_array_add(root, MPV_FORMAT_NODE_MAP);
node_map_add_string(entry, "name", cmd->name);
+
+ struct mpv_node *args =
+ node_map_add(entry, "args", MPV_FORMAT_NODE_ARRAY);
+ for (int i = 0; i < MP_CMD_DEF_MAX_ARGS; i++) {
+ const struct m_option *a = &cmd->args[i];
+ if (!a->type)
+ break;
+ struct mpv_node *ae = node_array_add(args, MPV_FORMAT_NODE_MAP);
+ node_map_add_string(ae, "name", a->name);
+ node_map_add_string(ae, "type", a->type->name);
+ node_map_add_flag(ae, "optional", a->flags & MP_CMD_OPT_ARG);
+ }
+
+ node_map_add_flag(entry, "vararg", cmd->vararg);
}
return M_PROPERTY_OK;