diff options
-rwxr-xr-x | meta/recipes-core/systemd/systemd-systemctl/systemctl | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/meta/recipes-core/systemd/systemd-systemctl/systemctl b/meta/recipes-core/systemd/systemd-systemctl/systemctl index 990de1ab39..de733e255b 100755 --- a/meta/recipes-core/systemd/systemd-systemctl/systemctl +++ b/meta/recipes-core/systemd/systemd-systemctl/systemctl | |||
@@ -282,7 +282,7 @@ def main(): | |||
282 | sys.exit("Python 3.4 or greater is required") | 282 | sys.exit("Python 3.4 or greater is required") |
283 | 283 | ||
284 | parser = argparse.ArgumentParser() | 284 | parser = argparse.ArgumentParser() |
285 | parser.add_argument('command', nargs=1, choices=['enable', 'mask', | 285 | parser.add_argument('command', nargs='?', choices=['enable', 'mask', |
286 | 'preset-all']) | 286 | 'preset-all']) |
287 | parser.add_argument('service', nargs=argparse.REMAINDER) | 287 | parser.add_argument('service', nargs=argparse.REMAINDER) |
288 | parser.add_argument('--root') | 288 | parser.add_argument('--root') |
@@ -300,7 +300,11 @@ def main(): | |||
300 | locations.append(BASE_LIBDIR / "systemd") | 300 | locations.append(BASE_LIBDIR / "systemd") |
301 | locations.append(LIBDIR / "systemd") | 301 | locations.append(LIBDIR / "systemd") |
302 | 302 | ||
303 | command = args.command[0] | 303 | command = args.command |
304 | if not command: | ||
305 | parser.print_help() | ||
306 | return 0 | ||
307 | |||
304 | if command == "mask": | 308 | if command == "mask": |
305 | for service in args.service: | 309 | for service in args.service: |
306 | SystemdUnit(root, service).mask() | 310 | SystemdUnit(root, service).mask() |