Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Add/update doc comments | Rory Dudley | 2024-06-30 | 1 | -2/+2 |
| | | | | | This patch update a ton of the documentation comments throughout the codebase, refactoring some areas, and adding new comments to others. | ||||
* | Updated the way built-in commands are called/used | Rory Dudley | 2024-06-04 | 1 | -10/+37 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, built-in commands were fairly primitive, merely outputting STDOUT and STDERR with the print! macros. However, we need them to behave like normal programs, that is: - Acknowledge their verse's meter (forking, piping, etc.), - Ability to capture STDOUT and STDERR (>, 2>), - and Affect the currently running environment. For these reasons, the anthology was reworked, and now contains the Anthology struct, which mimics both std::process::{Child, Command}. The AnthologyStdin helper struct was also created, for built-ins to take input on STDIN, though no built-in is currently using it. Each built-ins' incant functions were updated to return a std::process::Output. It contains output from STDOUT, output from STDERR, and the exit code of the "process". A fix was also implemented for aliases, where the STDOUT and STDERR vectors were not being copied to the newly constructed verse. Notes: There is some cleanup that needs to happen on this patch. For one, the spellcheck function is no longer being used, so there is a generic OS error if the program cannot be found in the $PATH. Also, anthology::lookup gets called twice, which shouldn't need to happen. | ||||
* | Sort output of 'export' and 'alias' | Rory Dudley | 2024-04-11 | 1 | -1/+3 |
| | | | | | Sort the output of the built-in 'export' and 'alias' commands, in cases where all environment variables/aliases are printed out. | ||||
* | Add docstring comments to all the anthology functions | Rory Dudley | 2024-03-31 | 1 | -0/+23 |
| | | | | | | Add docstring comments for all the incant function throughout the anthology, documenting what each function does, and an example of it's shell command. | ||||
* | Add the 'unset' built-in command | Rory Dudley | 2024-03-30 | 1 | -0/+15 |
| | | | | | Add the 'unset' command to remove global environment variable definitions from the shell. | ||||
* | The anthology module | Rory Dudley | 2024-03-28 | 1 | -0/+23 |
The anthology module was added to run built-in commands. The 'cd' and 'exit' built-ins were moved from the main recite() loop to this module. Additionally, the 'export' and 'source' built-ins were added. |