diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-11-22 14:35:57 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-11-22 15:02:12 +0100 |
| commit | a458b821e66bbb4336ad92b26a3645557a2dc98e (patch) | |
| tree | bf4f9008cddda1d490219d4fc951374a6c264c47 /sam.c | |
| parent | e4a2ae7bb0ccbcebbf95f498c5edac2a0ed75ad6 (diff) | |
| download | vis-a458b821e66bbb4336ad92b26a3645557a2dc98e.tar.gz vis-a458b821e66bbb4336ad92b26a3645557a2dc98e.tar.xz | |
vis: populate :set option map at startup
Diffstat (limited to 'sam.c')
| -rw-r--r-- | sam.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -375,6 +375,14 @@ bool sam_init(Vis *vis) { bool ret = true; for (const CommandDef *cmd = cmds; cmd && cmd->name; cmd++) ret &= map_put(vis->cmds, cmd->name, cmd); + + if (!(vis->options = map_new())) + return false; + for (int i = 0; i < LENGTH(options); i++) { + for (const char *const *name = options[i].names; *name; name++) + ret &= map_put(vis->options, *name, &options[i]); + } + return ret; } |
