fix: Make command required

This solves a weird issue where the help function is executed everytime
even when we specify a command.

Fixes #122.
This commit is contained in:
Giovanni Santini 2023-08-01 11:55:33 +02:00
parent bfa2f56e1f
commit c683254761

View file

@ -38,8 +38,7 @@ LIBDIR = None
class BlueprintApp:
def main(self):
self.parser = argparse.ArgumentParser()
self.subparsers = self.parser.add_subparsers(metavar="command")
self.parser.set_defaults(func=self.cmd_help)
self.subparsers = self.parser.add_subparsers(metavar="command", required=True)
compile = self.add_subcommand(
"compile", "Compile blueprint files", self.cmd_compile