mirror of
https://gitlab.freedesktop.org/upower/power-profiles-daemon.git
synced 2026-04-20 18:50:38 +02:00
Pass all unknown arguments to the launch command
Fixes: https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/issues/144
This commit is contained in:
parent
cb77e0ad34
commit
87fea13806
2 changed files with 13 additions and 1 deletions
|
|
@ -205,10 +205,12 @@ def get_parser():
|
|||
|
||||
|
||||
def main():
|
||||
args = get_parser().parse_args()
|
||||
args, unknown = get_parser().parse_known_args()
|
||||
# default behavior is to run list if no command is given
|
||||
if not args.command:
|
||||
args.func = _list
|
||||
if args.command == "launch":
|
||||
args.arguments += unknown
|
||||
args.func(args)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1682,6 +1682,16 @@ class Tests(dbusmock.DBusTestCase):
|
|||
|
||||
self.stop_daemon()
|
||||
|
||||
def test_unknown_args(self):
|
||||
self.create_platform_profile()
|
||||
self.start_daemon()
|
||||
self.assert_eventually(lambda: self.get_dbus_property("ActiveProfile"))
|
||||
|
||||
builddir = os.getenv("top_builddir", ".")
|
||||
tool_path = os.path.join(builddir, "src", "powerprofilesctl")
|
||||
|
||||
subprocess.check_call([tool_path, "launch", "true", "--foo"])
|
||||
|
||||
def test_vanishing_hold(self):
|
||||
self.create_platform_profile()
|
||||
self.start_daemon()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue