def main():
	global commands
	commands = Options.arg_line[:]

	while commands:
		x = commands.pop(0)

		ini = datetime.datetime.now()
		if x == 'configure':
			fun = configure
		elif x == 'build':
			fun = build
		else:
			fun = getattr(Utils.g_module, x, None)

		if not fun:
			raise Utils.WscriptError('No such command %r' % x)

		ctx = getattr(Utils.g_module, x + '_context', Utils.Context)()

		if x in ['init', 'shutdown', 'dist', 'distclean', 'distcheck']:
			# compatibility TODO remove in waf 1.6
			try:
				fun(ctx)
			except __HOLE__:
				fun()
		else:
			fun(ctx)

		ela = ''
		if not Options.options.progress_bar:
			ela = ' (%s)' % Utils.get_elapsed_time(ini)

		if x != 'init' and x != 'shutdown':
			info('%r finished successfully%s' % (x, ela))

		if not commands and x != 'shutdown':
			commands.append('shutdown')
dataset/ETHPy150Open appcelerator-archive/poc-nodejs-desktop/Resources/nodejs/builds/linux/node/lib/node/wafadmin/Scripting.py/main