Ensure newline at end of meta file
[stgit.git] / stg
bloba2d760b7dc733ba249a9822920abe21f9f791cfe
1 #!/usr/bin/env python3
2 import os
3 import sys
5 __copyright__ = """
6 Copyright (C) 2005, Catalin Marinas <catalin.marinas@gmail.com>
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License version 2 as
10 published by the Free Software Foundation.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, see http://www.gnu.org/licenses/.
19 """
21 if __name__ == '__main__':
22     if sys.version_info[:2] < (3, 5):
23         sys.stderr.write('StGit requires Python >= 3.5\n')
24         sys.exit(1)
26     if os.environ.get('COVERAGE_PROCESS_START'):
27         import sys
29         import coverage
31         if len(sys.argv) < 2 or sys.argv[1].startswith('-'):
32             context = 'stg'
33         else:
34             context = 'stg-' + sys.argv[1]
36         cov = coverage.process_startup()
37         cov.switch_context(context)
39     from stgit.main import main
41     main()