]> git.corax.cc Git - toolbox/commit
toolbox.sh: Make command-not-found errors more helpful
authorMatthias Kruk <m@m10k.eu>
Sat, 9 Jul 2022 02:50:06 +0000 (11:50 +0900)
committerMatthias Kruk <m@m10k.eu>
Sat, 9 Jul 2022 02:50:06 +0000 (11:50 +0900)
commit7f3910390b1b7720fe54307bec0656ec9e21e21c
treece15af135d485cf1a1d80e1e3d866fd160a1521b
parentf7efc3bc7bb955446318a9ef0eb14992203dbcea
toolbox.sh: Make command-not-found errors more helpful

Command-not-found errors often occur because the user forgot to
include a module. In such cases, it would be helpful if the default
error message included suggestions for modules to include.

This commit adds a `command_not_found_handle()` function that
overrides bash's default behavior: aside of the usual error message,
this function will print all module names that the missing function
may be part of (as determined by its name) to stderr.
toolbox.sh