From 3f81e15309e79cf8964f03949a33cdc7c30914e0 Mon Sep 17 00:00:00 2001 From: "Soren I. Bjornstad" Date: Thu, 26 Aug 2021 14:34:31 -0500 Subject: [PATCH] sort actions in alphabetical order in help --- tzk.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tzk.py b/tzk.py index 453fa17..1d8b1bf 100644 --- a/tzk.py +++ b/tzk.py @@ -208,7 +208,7 @@ class BuildCommand(CliCommand): parser = argparse.ArgumentParser() subparsers = parser.add_subparsers() -for command in CliCommand.__subclasses__(): +for command in sorted(CliCommand.__subclasses__(), key=lambda i: i.__name__): subparser = subparsers.add_parser(command.cmd, help=command.help) subparser.set_defaults(_cls=command) command.setup_arguments(subparser) # type: ignore