diff --git a/sat_frontends/jp/cmd_application.py b/sat_frontends/jp/cmd_application.py index 8a92456b..53e84176 100644 --- a/sat_frontends/jp/cmd_application.py +++ b/sat_frontends/jp/cmd_application.py @@ -34,17 +34,26 @@ class List(base.CommandBase): ) def add_parser_options(self): + # FIXME: "extend" would be better here, but it's only available from Python 3.8+ + # so we use "append" until minimum version of Python is raised. self.parser.add_argument( "-f", - "--filters", - action="extend", - nargs="+", + "--filter", + dest="filters", + action="append", choices=["available", "running"], - default=["available"], help=_("show applications with this status"), ) async def start(self): + + # FIXME: this is only needed because we can't use "extend" in + # add_parser_options, see note there + if self.args.filters: + self.args.filters = list(set(self.args.filters)) + else: + self.args.filters = ['available'] + try: found_apps = await self.host.bridge.applicationsList(self.args.filters) except Exception as e: