Skip to main content

Module definitions

Module definitions 

Source
Expand description

Reading command definition files and merging them into one library.

Layers are merged weakest first, so a later layer shadows an earlier one by entry id. Any layer may also hide entries by glob pattern without redefining them.

Structs§

NewEntry
A command on its way into the user’s library.

Enums§

Written
What upsert did to the file.

Functions§

append
Appends an entry to the user’s library, creating the file if needed.
appended
text with entry added as the last item of its commands list.
derive_tags
Words to know a command by, taken from the command itself.
disable
Hides an entry the user cannot delete, such as one compiled into the binary.
load
Loads the builtin library, overlaying the user’s own file when it exists.
merge_tags
Tags the user gave first, then the ones the command suggests.
parse_tags
Splits the comma separated tags a user typed into a clean list.
parse_user
Parses the text of a user library, checked the way loading checks it.
remove
Cuts an entry out of a library file, reporting whether it was there.
removed
text without the entry declared as id, or None if there is none.
split_purpose
Separates #tags from the answer to “what is it for?”.
suggest_id
Turns a command into an id that is stable, readable and not already taken.
upsert
Writes an entry into the user’s library, replacing one already declared under the same id.
upserted
text with entry in place of the one declared under its id, or added to the end of the list when there is none.
with_disabled
text with pattern added to its disabled list.
with_enabled
text with pattern taken off its disabled list, if it was on it.