Skip to content

iash release "Juno"

Pre-release
Pre-release
Compare
Choose a tag to compare
@hal7df hal7df released this 26 Aug 04:09

This release overhauls the entire iash API to something much more useful than in releases v0.1 and v0.2 (hence the version bump). As such, this release is completely backwards-incompatible with v0.1 and v0.2. There is still much work to do, but the APIs should now more closely resemble what they will look like on the first stable release.

Quick API Rundown

iash no longer requires you to write the main event loop manually (!!). Instead, iash programs now have a more well-defined structure:

  1. Each command that the user can run is implemented as a subclass of Command, which has two pure virtual methods getName() and run() that need to be overridden for the command to work properly. Command has a few other virtual methods that can be overridden for extra command validation functionality.
  2. All commands are registered with the shell instance using the templated addCommand() function in the iash class.
  3. After all commands are registered, the runInteractive() and runScript() functions of the shell object can be used to create the shell. Ideally, these functions should be the return value for main, as these will return the exit code of the shell.

New Features

  • Directory is a class that provides cross-platform directory traversal and management features.
  • Environment is a class that provides access to the environment variables set on the iash command line (Full command line access is not yet complete)
  • UserCommand is a class that is passed to each command containing the command's arguments, as well as functions to determine which options are present.
  • Windows builds are working, but are still very experimental. Use at your own risk.

Provided commands

Release v0.5 provides only the following commands by default:

  • cat: iash implementation of Unix cat that is almost functionally complete with GNU cat (the -v flag only shows carriage returns)
  • clear: Clears the screen. Currently only works on Unix.
  • echo: Basic implementation of echo (no functional options)
  • exit: Exits the shell, with a specific return value, or 0 if not given.
  • pwd: Prints the shell's current directory.

iash is no longer a preregistered command, although will probably be used in a future release to allow execution of scripts from inside of an iash shell.