summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/lesana17
1 files changed, 1 insertions, 16 deletions
diff --git a/scripts/lesana b/scripts/lesana
index c8e6b7f..8e34179 100755
--- a/scripts/lesana
+++ b/scripts/lesana
@@ -8,7 +8,7 @@ import argparse
import lesana.command
-class Lesana:
+class Lesana(lesana.command.MainCommand):
"""
Manage collections
"""
@@ -25,21 +25,6 @@ class Lesana:
("rm", lesana.command.Remove()),
)
- def _main(self, args):
- self.parser.print_help()
-
- def main(self):
- self.parser = argparse.ArgumentParser()
- self.parser.set_defaults(func=self._main)
- self.subparsers = self.parser.add_subparsers()
- for name, sub in self.commands:
- s_parser = self.subparsers.add_parser(name, help=sub.help)
- for arg in sub.arguments:
- s_parser.add_argument(*arg[0], **arg[1])
- s_parser.set_defaults(func=sub._main)
- self.args = self.parser.parse_args()
- self.args.func(self.args)
-
if __name__ == "__main__":
Lesana().main()