
import os, sys, time
from PyQt5.QtWidgets import QApplication
from fexqt.mainwin import MainWin

def main():
	app = QApplication(sys.argv)
	args = sys.argv[1:]
	files = [arg for arg in args if os.path.isfile(arg)]
	flags = [arg for arg in args if arg[0] == '-']
	other = [arg for arg in args if arg not in files + flags]
	print(' INFO: Fex starting on %s' %(time.asctime(time.localtime())))
	# TODO create logger
	if flags:
		print(' WARN: ignoring unrecognized flags: ', flags)
	if other:
		print(' WARN: ignoring unrecognized arguments: ', other)
	win = MainWin(files)
	return app.exec_()

