def jack_compiler(): path = Util.get_command_line_argument(1) if os.path.isdir(path): files = FileSet(path, 'jack') while files.has_more_files(): filename = files.next_file() JackCompiler.compile_jack(filename) elif os.path.isfile(path): JackCompiler.compile_jack(path) else: print('{} is not a file or dir'.format(path))