selftest.run: Factor out expand_command_list.
[ira/wip.git] / selftest / run.py
index 4ef10de14243373b7f1627fa52a4626db96882aa..c40dd7e389f2ba9fdc8c3deaf69a455a41fbf289 100644 (file)
@@ -15,7 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-import os
+import subprocess
+import warnings
 
 # expand strings from %ENV
 def expand_environment_strings(s, vars):
@@ -26,4 +27,7 @@ def expand_environment_strings(s, vars):
     return s
 
 
-
+def expand_command_list(cmd):
+    if not "$LISTOPT" in cmd:
+        return None
+    return cmd.replace("$LISTOPT", "--list")