jupyterlite / cockle

In-browser bash-like shell implemented in TypeScript.
BSD 3-Clause "New" or "Revised" License
3 stars 2 forks source link

Add options/flags for built-in commands #31

Closed ianthomas23 closed 3 months ago

ianthomas23 commented 3 months ago

Add options/flags for built-in commands. These are commands that are implemented in TypeScript rather than WebAssembly, and correspond to commands that would be implemented in the shell. Current examples supported are history -c to clear the history, and alias ls='ls -F' to set an alias.

Most of the code for this was implemented in cockle right at the beginning, before addition of the WASM commands, so this is just reintroducing it and tidying it up somewhat.

Built-in commands that are exported in src/builtin/index.ts are automaticaly registered in the CommandRegistry.