diff options
author | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-05-23 14:23:16 +0000 |
---|---|---|
committer | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-05-23 14:23:16 +0000 |
commit | 22c3204495f1a5e55aaf84a850fb892d1ecb6fe8 (patch) | |
tree | aa37c3ead92c2892017c037479fadd2e42f5490f /Src/params.c | |
parent | 00772b72a7a79b6f35b1b805c305a4b6fc285659 (diff) | |
download | zsh-22c3204495f1a5e55aaf84a850fb892d1ecb6fe8.tar.gz zsh-22c3204495f1a5e55aaf84a850fb892d1ecb6fe8.tar.xz zsh-22c3204495f1a5e55aaf84a850fb892d1ecb6fe8.zip |
add -[ak] options to compadd (11533)
Diffstat (limited to 'Src/params.c')
-rw-r--r-- | Src/params.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Src/params.c b/Src/params.c index 8c39ec2ac..aa20e79f4 100644 --- a/Src/params.c +++ b/Src/params.c @@ -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) |