iash release "Juno"
Pre-release
Pre-release
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:
- Each command that the user can run is implemented as a subclass of
Command
, which has two pure virtual methodsgetName()
andrun()
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. - All commands are registered with the shell instance using the templated
addCommand()
function in theiash
class. - After all commands are registered, the
runInteractive()
andrunScript()
functions of the shell object can be used to create the shell. Ideally, these functions should be the return value formain
, 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 Unixcat
that is almost functionally complete with GNUcat
(the-v
flag only shows carriage returns)clear
: Clears the screen. Currently only works on Unix.echo
: Basic implementation ofecho
(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.