1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-11-01 06:20:55 +01:00

add -[ak] options to compadd (11533)

This commit is contained in:
Sven Wischnowsky 2000-05-23 14:23:16 +00:00
parent 00772b72a7
commit 22c3204495
6 changed files with 77 additions and 12 deletions

View file

@ -1741,6 +1741,21 @@ gethparam(char *s)
return NULL;
}
/* Retrieve the keys of an assoc array parameter as an array */
/**/
mod_export char **
gethkparam(char *s)
{
struct value vbuf;
Value v;
if (!idigit(*s) && (v = getvalue(&vbuf, &s, 0)) &&
PM_TYPE(v->pm->flags) == PM_HASHED)
return paramvalarr(v->pm->gets.hfn(v->pm), SCANPM_WANTKEYS);
return NULL;
}
/**/
mod_export Param
setsparam(char *s, char *val)