Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
Puts Debuggerer
Ruby library for improved puts debugging, automatically displaying bonus useful information such as source line number and source code.
code: https://github.com/koreaneggroll/shell
Thanks a lot for the compliment. But I should say that the code for the commands to actually work is taken from here: https://github.com/brenns10/lsh/blob/master/src/main.c(as I said in the credits). My code is actually just the commands.
https://github.com/ midnqp/libavoidrepitition-c
And for improved readability, consider registering commands by placing structures representing them into linker section, and dynamically walking it at runtime. In this way you do not need to explicitly have an array with handlers in them like in the example I linked above, but rather leave it up to the linker so you can, in effect, "discover" supported commands at runtime.