Mercurial > hgrepos > Python > apps > py-cutils
diff cutils/treesum.py @ 174:fc1055878775
Use "return 0" instead of "sys.exit(0)" when printing version and help#
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Fri, 10 Jan 2025 15:34:50 +0100 |
| parents | e081b6ee5570 |
| children | 7f5d05a625fd |
line wrap: on
line diff
--- a/cutils/treesum.py Fri Jan 10 12:46:44 2025 +0100 +++ b/cutils/treesum.py Fri Jan 10 15:34:50 2025 +0100 @@ -183,7 +183,7 @@ if opts.subcommand == "version": print("%s (rv:%s)" % (__version__, __revision__), file=sys.stdout) - sys.exit(0) + return 0 if opts.subcommand == "help": if not opts.help_command: parser.print_help() @@ -198,7 +198,7 @@ hparser.print_help() else: parser.print_help() - sys.exit(0) + return 0 # Reparse strictly opts = parser.parse_args(args=argv)
