$ cat ~/devlog/wallshell-v2_0_0.md

WallShell v2.0.0

First devlog for WallShell.

WallShell v2.0.0 is out.

This update completely broke the old command interface, so the major version has been bumped. Anything using WallShell v1.0.0 must be updated to the new command interface.

Command Structure

I completely changed how commands are defined.

There are now optional main function signatures:

  • int main(void)
    • Meant for functions that don't need arguments.
  • int main(int, char**)
    • Regular functions that take argc and argv.
  • int main(int, char**, char**)
    • Functions that also need ENV.
    • ENV is not guaranteed to be provided to commands and can be NULL. WallShell must be passed ENV before ws_terminalMain() is called for commands to receive it.

WallShell will only dispatch to the most specific main function supplied.

Commands can now specify what arguments they take, and WallShell will automatically handle the help entries.

Commands can also specify version info if relevant.

Argument Handling

I added functions that let you extract arguments from argc and argv.

There are some restrictions on this, especially with how concurrent commands work. This will be documented eventually.

Name Changes

The default config file is now ws_config.h.

New Config Options

  • MAX_ARGPARSE_NODES
    • Max number of parsed argparse entries a single ws_context_t can hold when DISABLE_MALLOC is defined.
    • Default is 32.

Fixed Issues

  • [#6] Arguments in quotes are now counted as a single argument ("this is a single arg")
  • [#7] ws_sleep() being incorrectly required when THREADED_SUPPORT was disabled
  • [#10] __has_include() on the config file
  • [#13] C++ ifdef

Upcoming

Here's what's planned for future releases:

  • Current working directory (CWD) support
    • This will be optional, but will let commands have a better interface to work with files
  • A better interface for input options
    • Meant to make it easier for freestanding implementations to provide control input if it doesn't have VT100 escape codes
  • Better freestanding support, by letting the implementer specify how to print
    • Currently requires fprintf() which isn't always present and isn't always easy to implement around.
  • A callback for the exit command in threaded environments ([#8])
  • "Launch commands" ([#4])
    • An optional list of commands to run when ws_terminalMain() is called, before WallShell starts accepting user input.
  • Better freestanding documentation and examples

← all devlog entries