HomeFreeBSD

sh: introduce a function to iterate over all hashed commands

Description

sh: introduce a function to iterate over all hashed commands

While aliases and built-ins are opportunistically stored in cmdtable, each
function will be added to it immediately on definition.

Factor out the hashing function, write the iterator function and make it use
the hashing function.

Add the cmdname pointer to struct cmdentry so that the command name can be
exposed that way.

Differential Revision: https://reviews.freebsd.org/D40619

Details

Provenance
pstefAuthored on Apr 30 2023, 4:30 PM
Differential Revision
D40619: sh: auto-complete functions and aliases
Parents
rG0fd450e2895e: sh: tab-complete aliases
Branches
Unknown
Tags
Unknown