sst-elements icon indicating copy to clipboard operation
sst-elements copied to clipboard

Proposed Ariel interface improvement

Open plavin opened this issue 2 years ago • 0 comments

Specifying the arguments to Ariel can be tedious. Users must specify each argument to the program individually. Environment variables are twice as annoying, as each environment value's name must be given individually, as well as their values.

I believe it would be useful to have function that parses a standard bash command and automatically formats this for Ariel.

I've created such a program in python, here.

Some examples if its ussage:

parseAriel('./mycommand -n 20')
  -> {'executable': './mycommand', 'appargcount': 2, 'apparg0': '-n', 'apparg1': '20'}

 parseAriel('./mycommand < infile.txt > outfile.txt 2>> errfile.txt')
 -> {'executable': './mycommand', 'appstdin': 'infile.txt', 'appstdout': 'outfile.txt', 'appstdoutappend': 0, 'appstderr': 'errfile.txt', 'appstderrappend': 1}

 parseAriel('MYENVVAR=20 ./mycommand')
 -> {'executable': './mycommand', 'envparamcount': 1, 'envparamname0': 'MYENVVAR', 'envparamval0': '20'}

Does this seem like something that would be useful to have in SST? If so, where would it belong?

This relies on a python library called bashlex, which is GPLv3. I'm not sure if you are interested in having any external python dependencies, or if the license is compatible with this project.

Note that this also parses IO redirection, which is a feature proposed in #1856.

plavin avatar Mar 31 '22 22:03 plavin