From de96bfee15b05fe51b0ae655444ad100bd3f8d8b Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Thu, 21 May 2020 10:34:36 +1000 Subject: [PATCH] List parser defaults before arguments --- src/pyelephant.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pyelephant.py b/src/pyelephant.py index ab275d2..1a42510 100755 --- a/src/pyelephant.py +++ b/src/pyelephant.py @@ -63,12 +63,12 @@ if __name__ == '__main__': subparsers = parser.add_subparsers() add_parser = subparsers.add_parser('add') - add_parser.add_argument("title", type=str) add_parser.set_defaults(func=add) + add_parser.add_argument("title", type=str) rm_parser = subparsers.add_parser('rm') - rm_parser.add_argument("index", type=int) rm_parser.set_defaults(func=rm) + rm_parser.add_argument("index", type=int) show_parser = subparsers.add_parser('show') show_parser.set_defaults(func=show_by_id)