Skip to content

Commit

Permalink
Change order of CLI opts and extend parser for ModulesInfo. Fixes #26
Browse files Browse the repository at this point in the history
  • Loading branch information
TomTheBear committed Nov 21, 2023
1 parent 6122d86 commit 246fd5d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions machinestate.py
Original file line number Diff line number Diff line change
Expand Up @@ -2983,7 +2983,7 @@ def __init__(self, extended=False, anonymous=False, modulecmd="modulecmd"):
anonymous=anonymous)
self.modulecmd = modulecmd
parse = ModulesInfo.parsemodules
cmd_opts = "sh list -t 2>&1"
cmd_opts = "sh -t list 2>&1"
cmd = modulecmd
abspath = which(cmd)
if modulecmd is not None and len(modulecmd) > 0:
Expand All @@ -3001,8 +3001,10 @@ def __init__(self, extended=False, anonymous=False, modulecmd="modulecmd"):
self.addc("Loaded", abscmd, cmd_opts, None, parse)
@staticmethod
def parsemodules(value):
slist = re.split("\n", value)
return slist[1:]
slist = [ x for x in re.split("\n", value) if ";" not in x ]
if re.match("^Currently Loaded.+$", slist[0]):
slist = slist[1:]
return slist

################################################################################
# Infos about interrupt handling
Expand Down

0 comments on commit 246fd5d

Please sign in to comment.