MCPcopy Index your code
hub / github.com/python/cpython / parseOptions

Function parseOptions

Mac/BuildScript/build-installer.py:637–717  ·  view source on GitHub ↗

Parse arguments and update global settings.

(args=None)

Source from the content-addressed store, hash-verified

635 print("Setting default PATH: %s"%(os.environ['PATH']))
636
637def parseOptions(args=None):
638 """
639 Parse arguments and update global settings.
640 """
641 global WORKDIR, DEPSRC, SRCDIR, DEPTARGET
642 global UNIVERSALOPTS, UNIVERSALARCHS, ARCHLIST, CC, CXX
643 global FW_VERSION_PREFIX
644 global FW_SSL_DIRECTORY
645
646 if args is None:
647 args = sys.argv[1:]
648
649 try:
650 options, args = getopt.getopt(args, '?hb',
651 [ 'build-dir=', 'third-party=', 'sdk-path=' , 'src-dir=',
652 'dep-target=', 'universal-archs=', 'help' ])
653 except getopt.GetoptError:
654 print(sys.exc_info()[1])
655 sys.exit(1)
656
657 if args:
658 print("Additional arguments")
659 sys.exit(1)
660
661 deptarget = None
662 for k, v in options:
663 if k in ('-h', '-?', '--help'):
664 print(USAGE)
665 sys.exit(0)
666
667 elif k in ('-d', '--build-dir'):
668 WORKDIR=v
669
670 elif k in ('--third-party',):
671 DEPSRC=v
672
673 elif k in ('--sdk-path',):
674 print(" WARNING: --sdk-path is no longer supported")
675
676 elif k in ('--src-dir',):
677 SRCDIR=v
678
679 elif k in ('--dep-target', ):
680 DEPTARGET=v
681 deptarget=v
682
683 elif k in ('--universal-archs', ):
684 if v in UNIVERSALOPTS:
685 UNIVERSALARCHS = v
686 ARCHLIST = universal_opts_map[UNIVERSALARCHS]
687 if deptarget is None:
688 # Select alternate default deployment
689 # target
690 DEPTARGET = default_target_map.get(v, '10.5')
691 else:
692 raise NotImplementedError(v)
693
694 else:

Callers 1

mainFunction · 0.85

Calls 7

getTargetCompilersFunction · 0.85
getVersionFunction · 0.85
strFunction · 0.85
getFullVersionFunction · 0.85
exitMethod · 0.45
getMethod · 0.45
abspathMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…