From 3fabfdb978483c008352c1b5b03d632f559c5a79 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=A9dric=20Aguerre?= Date: Wed, 2 Nov 2016 11:24:58 +0100 Subject: [PATCH] salome info --sotwares: can provide a list of softwares --- bin/salomeContext.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/bin/salomeContext.py b/bin/salomeContext.py index bc963fff1..71f3aea55 100644 --- a/bin/salomeContext.py +++ b/bin/salomeContext.py @@ -447,10 +447,12 @@ class SalomeContext: epilog = """\n Display some information about SALOME.\n Available options are: - -p,--ports Show the list of busy ports (running SALOME instances). - -s,--softwares Show the list and versions of SALOME softwares. - -v,--version Show running SALOME version. - -h,--help Show this message. + -p,--ports Show the list of busy ports (running SALOME instances). + -s,--softwares [software(s)] Show the list and versions of SALOME softwares. + Software names must be separated by blank characters. + If no software is given, show version of all softwares. + -v,--version Show running SALOME version. + -h,--help Show this message. """ if not args: args = ["--version"] @@ -467,7 +469,14 @@ Available options are: print "Last started instance on port %s"%ports[-1] if "-s" in args or "--softwares" in args: - self._showSoftwareVersions() + if "-s" in args: + index = args.index("-s") + else: + index = args.index("--softwares") + indexEnd=index+1 + while indexEnd < len(args) and args[indexEnd][0] != "-": + indexEnd = indexEnd + 1 + self._showSoftwareVersions(softwares=args[index+1:indexEnd]) if "-v" in args or "--version" in args: print "Running with python", platform.python_version() -- 2.39.2