import stgit.commands
from stgit.out import *
-from stgit import utils
+from stgit import run, utils
#
# The commands map
#
# The main function (command dispatcher)
#
-def main():
+def _main():
"""The main function
"""
global prog
sys.exit(utils.STGIT_BUG_ERROR)
sys.exit(ret or utils.STGIT_SUCCESS)
+
+def main():
+ try:
+ _main()
+ finally:
+ run.finish_logging()