"ifthen" for more "dynamic" argv manipulation

From: Max Ivanov <ivanov.maxim_at_gmail.com>
Date: Tue, 24 May 2016 13:21:56 +0100


I'd like to discuss an idea of more dynamic argv manipulation.

Since execline heavily relies on chain loading it becomes very
important whether block is executed directly or via fork; add to that
extreme importance of ENV vars as a way to carry state through chain
loading and it becomes extremely painful at a times and leads to more
verbose code.

What if new `ifthen` commands was manipulating argv ? For instance
this code would be possible then

ifthen { s6-test -n ${DISCARD_ENV} }
   exec -c

then instead of exec`ing into one or another it would compose argv
dynamically and execute into it:

true case:
[ "exec", "-c", "prog1", ....]

false case:
[ "prog1", ...]

with such class of commands it would be easier to compose optional bits of code

What do you think?
Received on Tue May 24 2016 - 12:21:56 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:38:49 UTC