Open Danny- opened 6 years ago
Attached is an example file that is way to complicated :) - and minstructor could help here a lot.
Some features can already be solved with zsh
:
$ minstructor 'typeset -A hash; hash[foo]=bar; hash[baz]=qux; VAR=[foo,baz]; echo ${hash[$VAR]}'
bar
qux
This works, because [word]
is not interpreted as a list by minstructor
.
You can also refer to a list value more than once:
minstructor 'VAR=[1,2,3]; echo $VAR other stuff $VAR again'
1 other stuff 1 again
2 other stuff 2 again
3 other stuff 3 again
In the default configuration the usage of associative shell arrays is not possible any more, because single or empty lists are now handled by the minstructor. Thus [foo]
will be interpreted as a list with one value by the minstructor. To use associative shell arrays in your minstructor commands again you can now change the list delimiter of the minstructor.
Priority: low Note: The proposed feature of lockstep parameters can be achieved for instance with loops calling the minstructor.
Using parameters in lockstep mode.
From time to time there are two or more distinct parameter sets that should be combined such that each element of one set has a linked element of another set. E.g. imagine a program animal that prints
Thes proposed output of minstructor could be:
Refer to interesting internal names.
A similar syntax could be used to refer to interesting internals (which should be defined in the documentation). E.g:
Further refinements.
Note: details must still be figured out. E.g. what sign should start the lockstep mode? Do you need the same sign at the end of the lockstep mode? Is e.g. '@ + name' enough to refer to lists/names? Is it possible to further refine such an syntax, e.g.