-
Notifications
You must be signed in to change notification settings - Fork 1
Command Parsing
As present, the interface for specifying the executable to Ariel is rather cumbersome. Personally, I would prefer to just write a bash command and give it to Ariel so it can do the rest.
The current interface requires users specify:
executable
envparamcount
envparamname<n>
envparamval<n>
appargcount
apparg<n>
These are all things that would normally be parsed for you from a command. For instance, you would need to transform DEBUG=1 ./myprog -n 4
into a python dict containing:
executable = ./myprog
envparamcount = 1
envparamname0 = DEBUG
envparamval0 = 1
appargcount = 2
apparg0 = -n
apparg1 = 4
This is rather cumbersome, and will require users to come up with utility functionality. While there are many interfaces that we could come up with, a simple one would be to let users write an entire command as they would for bash and pass it into Ariel for it to parse.
We can use the bashlex project to help us here. It accepts a bash command as input, parses it, and provides an AST for us to use to create the Ariel parameters.
Right now, this functionality is implemented in the parseAriel
function in specutils/ariel_utils.py
on the spec
branch. Link.
- Parse commands and options
- Support redirecting stdin with <
- Support stdout >
- Support stderr 2>
- Support append mode for stdout/stderr
- Parse environment variables
- Parse standard file descriptors
- Integrate into SST's python frontend
- Add support for pipes. Simulate one program after another. This is a much larger change than the rest.
This is related to Ariel Redirect IO.