MCPcopy Create free account
hub / github.com/cztomczak/cefpython / command_line_args

Function command_line_args

tools/build.py:129–204  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

127
128
129def command_line_args():
130 global DEBUG_FLAG, FAST_FLAG, CLEAN_FLAG, KIVY_FLAG, HELLO_WORLD_FLAG, \
131 REBUILD_CPP, VERSION, UNITTESTS
132
133 VERSION = get_version_from_command_line_args(__file__)
134 # Other scripts called by this script expect that version number
135 # is available in sys.argv, so don't remove it like it's done
136 # for all other args starting with "--".
137 if not VERSION:
138 print(__doc__)
139 sys.exit(1)
140
141 print("[build.py] Parse command line arguments")
142
143 global SYS_ARGV_ORIGINAL
144 SYS_ARGV_ORIGINAL = copy.copy(sys.argv)
145
146 if "--unittests" in sys.argv:
147 UNITTESTS = True
148 print("[build.py] Running examples disabled (--unittests)")
149 sys.argv.remove("--unittests")
150
151 if "--debug" in sys.argv:
152 DEBUG_FLAG = True
153 print("[build.py] DEBUG mode On")
154 sys.argv.remove("--debug")
155
156 if "--fast" in sys.argv:
157 # Fast mode doesn't delete C++ .o .a files.
158 # Fast mode also disables optimization flags in setup/setup.py .
159 FAST_FLAG = True
160 print("[build.py] FAST mode On")
161 sys.argv.remove("--fast")
162
163 if "--clean" in sys.argv:
164 CLEAN_FLAG = True
165 sys.argv.remove("--clean")
166
167 if "--kivy" in sys.argv:
168 KIVY_FLAG = True
169 print("[build.py] KIVY example")
170 sys.argv.remove("--kivy")
171
172 if "--hello-world" in sys.argv:
173 HELLO_WORLD_FLAG = True
174 print("[build.py] HELLO WORLD example")
175 sys.argv.remove("--hello-world")
176
177 # Rebuild c++ projects
178 if "--rebuild-cpp" in sys.argv:
179 REBUILD_CPP = True
180 print("[build.py] REBUILD_CPP mode enabled")
181 sys.argv.remove("--rebuild-cpp")
182
183 global ENABLE_PROFILING
184 if "--enable-profiling" in sys.argv:
185 print("[build.py] cProfile profiling enabled")
186 ENABLE_PROFILING = True

Callers 1

mainFunction · 0.70

Calls 2

copyMethod · 0.80

Tested by

no test coverage detected